From 007b1a4c82565ba1183126a217e461802b2e56f8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 22 Jun 2021 07:05:48 +0000 Subject: [PATCH] CodeGen from PR 14834 in Azure/azure-rest-api-specs Merge 3a1bed3a7c88c5b5ac2388b3d2f56c12c72956c8 into c059fb47f87a35ce5a90631883dfba8f01a41d8e --- eng/versioning/version_client.txt | 1 + .../CHANGELOG.md | 5 + .../README.md | 101 + .../pom.xml | 86 + .../generated/ContainerRegistryManager.java | 396 ++ .../generated/fluent/AgentPoolsClient.java | 309 ++ .../fluent/ConnectedRegistriesClient.java | 355 ++ .../ContainerRegistryManagementClient.java | 144 + .../fluent/ExportPipelinesClient.java | 212 + .../fluent/ImportPipelinesClient.java | 212 + .../generated/fluent/OperationsClient.java | 36 + .../generated/fluent/PipelineRunsClient.java | 212 + .../PrivateEndpointConnectionsClient.java | 213 + .../generated/fluent/RegistriesClient.java | 647 +++ .../generated/fluent/ReplicationsClient.java | 287 ++ .../generated/fluent/RunsClient.java | 240 ++ .../generated/fluent/ScopeMapsClient.java | 286 ++ .../generated/fluent/TaskRunsClient.java | 301 ++ .../generated/fluent/TasksClient.java | 309 ++ .../generated/fluent/TokensClient.java | 280 ++ .../generated/fluent/WebhooksClient.java | 386 ++ .../fluent/models/AgentPoolInner.java | 182 + .../models/AgentPoolQueueStatusInner.java | 50 + .../fluent/models/CallbackConfigInner.java | 82 + .../fluent/models/ConnectedRegistryInner.java | 294 ++ .../fluent/models/EventInfoInner.java | 50 + .../generated/fluent/models/EventInner.java | 93 + .../fluent/models/ExportPipelineInner.java | 174 + .../GenerateCredentialsResultInner.java | 81 + .../fluent/models/ImportPipelineInner.java | 204 + .../models/OperationDefinitionInner.java | 169 + .../fluent/models/PipelineRunInner.java | 137 + .../PrivateEndpointConnectionInner.java | 123 + .../models/PrivateLinkResourceInner.java | 172 + .../fluent/models/RegistryInner.java | 479 +++ .../RegistryListCredentialsResultInner.java | 81 + .../models/RegistryNameStatusInner.java | 105 + .../models/RegistryUsageListResultInner.java | 55 + .../fluent/models/ReplicationInner.java | 158 + .../fluent/models/RunGetLogResultInner.java | 76 + .../generated/fluent/models/RunInner.java | 635 +++ .../fluent/models/ScopeMapInner.java | 147 + .../models/SourceUploadDefinitionInner.java | 79 + .../generated/fluent/models/TaskInner.java | 413 ++ .../generated/fluent/models/TaskRunInner.java | 195 + .../generated/fluent/models/TokenInner.java | 159 + .../generated/fluent/models/WebhookInner.java | 163 + .../generated/fluent/models/package-info.java | 6 + .../generated/fluent/package-info.java | 6 + .../implementation/AgentPoolImpl.java | 240 ++ .../AgentPoolQueueStatusImpl.java | 33 + .../implementation/AgentPoolsClientImpl.java | 1637 ++++++++ .../implementation/AgentPoolsImpl.java | 216 + .../implementation/CallbackConfigImpl.java | 44 + .../ConnectedRegistriesClientImpl.java | 1840 +++++++++ .../ConnectedRegistriesImpl.java | 208 + .../implementation/ConnectedRegistryImpl.java | 264 ++ ...tainerRegistryManagementClientBuilder.java | 146 + ...ContainerRegistryManagementClientImpl.java | 476 +++ .../generated/implementation/EventImpl.java | 43 + .../implementation/EventInfoImpl.java | 33 + .../implementation/ExportPipelineImpl.java | 169 + .../ExportPipelinesClientImpl.java | 1149 ++++++ .../implementation/ExportPipelinesImpl.java | 193 + .../GenerateCredentialsResultImpl.java | 45 + .../implementation/ImportPipelineImpl.java | 179 + .../ImportPipelinesClientImpl.java | 1149 ++++++ .../implementation/ImportPipelinesImpl.java | 193 + .../OperationDefinitionImpl.java | 51 + .../implementation/OperationsClientImpl.java | 270 ++ .../implementation/OperationsImpl.java | 47 + .../implementation/PipelineRunImpl.java | 133 + .../PipelineRunsClientImpl.java | 1140 ++++++ .../implementation/PipelineRunsImpl.java | 189 + .../PrivateEndpointConnectionImpl.java | 160 + .../PrivateEndpointConnectionsClientImpl.java | 1181 ++++++ .../PrivateEndpointConnectionsImpl.java | 211 + .../PrivateLinkResourceImpl.java | 65 + .../implementation/RegistriesClientImpl.java | 3574 +++++++++++++++++ .../implementation/RegistriesImpl.java | 387 ++ .../implementation/RegistryImpl.java | 450 +++ .../RegistryListCredentialsResultImpl.java | 45 + .../RegistryNameStatusImpl.java | 41 + .../RegistryUsageListResultImpl.java | 41 + .../implementation/ReplicationImpl.java | 216 + .../ReplicationsClientImpl.java | 1464 +++++++ .../implementation/ReplicationsImpl.java | 189 + .../implementation/RunGetLogResultImpl.java | 37 + .../generated/implementation/RunImpl.java | 156 + .../implementation/RunsClientImpl.java | 1339 ++++++ .../generated/implementation/RunsImpl.java | 134 + .../implementation/ScopeMapImpl.java | 186 + .../implementation/ScopeMapsClientImpl.java | 1457 +++++++ .../implementation/ScopeMapsImpl.java | 189 + .../SourceUploadDefinitionImpl.java | 37 + .../generated/implementation/TaskImpl.java | 359 ++ .../generated/implementation/TaskRunImpl.java | 235 ++ .../implementation/TaskRunsClientImpl.java | 1597 ++++++++ .../implementation/TaskRunsImpl.java | 213 + .../implementation/TasksClientImpl.java | 1620 ++++++++ .../generated/implementation/TasksImpl.java | 213 + .../generated/implementation/TokenImpl.java | 191 + .../implementation/TokensClientImpl.java | 1434 +++++++ .../generated/implementation/TokensImpl.java | 189 + .../generated/implementation/Utils.java | 204 + .../generated/implementation/WebhookImpl.java | 291 ++ .../implementation/WebhooksClientImpl.java | 2128 ++++++++++ .../implementation/WebhooksImpl.java | 256 ++ .../implementation/package-info.java | 6 + .../generated/models/Action.java | 31 + .../generated/models/ActionsRequired.java | 34 + .../models/ActivationProperties.java | 39 + .../generated/models/ActivationStatus.java | 34 + .../generated/models/Actor.java | 53 + .../generated/models/AgentPool.java | 313 ++ .../generated/models/AgentPoolListResult.java | 81 + .../models/AgentPoolQueueStatus.java | 25 + .../models/AgentPoolUpdateParameters.java | 79 + .../generated/models/AgentPools.java | 170 + .../generated/models/AgentProperties.java | 50 + .../generated/models/Architecture.java | 43 + .../generated/models/Argument.java | 113 + .../generated/models/AuditLogStatus.java | 34 + .../generated/models/AuthInfo.java | 163 + .../models/AuthInfoUpdateParameters.java | 154 + .../generated/models/BaseImageDependency.java | 154 + .../models/BaseImageDependencyType.java | 34 + .../generated/models/BaseImageTrigger.java | 165 + .../models/BaseImageTriggerType.java | 34 + .../BaseImageTriggerUpdateParameters.java | 161 + .../generated/models/CallbackConfig.java | 32 + .../generated/models/CertificateType.java | 31 + .../generated/models/ConnectedRegistries.java | 171 + .../generated/models/ConnectedRegistry.java | 320 ++ .../models/ConnectedRegistryListResult.java | 86 + .../models/ConnectedRegistryMode.java | 34 + .../ConnectedRegistryUpdateParameters.java | 114 + .../generated/models/ConnectionState.java | 40 + .../generated/models/ConnectionStatus.java | 40 + .../generated/models/Credentials.java | 99 + .../models/CustomRegistryCredentials.java | 128 + .../generated/models/DefaultAction.java | 34 + .../generated/models/DockerBuildRequest.java | 374 ++ .../DockerBuildStepUpdateParameters.java | 209 + .../generated/models/DockerTaskStep.java | 214 + .../models/EncodedTaskRunRequest.java | 293 ++ .../generated/models/EncodedTaskStep.java | 133 + .../EncodedTaskStepUpdateParameters.java | 127 + .../generated/models/EncryptionProperty.java | 80 + .../generated/models/EncryptionStatus.java | 34 + .../generated/models/Event.java | 38 + .../generated/models/EventContent.java | 225 ++ .../generated/models/EventInfo.java | 24 + .../generated/models/EventListResult.java | 84 + .../generated/models/EventRequestMessage.java | 158 + .../models/EventResponseMessage.java | 155 + .../generated/models/ExportPipeline.java | 206 + .../models/ExportPipelineListResult.java | 85 + .../ExportPipelineTargetProperties.java | 116 + .../generated/models/ExportPipelines.java | 142 + .../generated/models/ExportPolicy.java | 50 + .../generated/models/ExportPolicyStatus.java | 34 + .../generated/models/FileTaskRunRequest.java | 292 ++ .../generated/models/FileTaskStep.java | 132 + .../models/FileTaskStepUpdateParameters.java | 127 + .../models/GenerateCredentialsParameters.java | 107 + .../models/GenerateCredentialsResult.java | 33 + .../generated/models/IdentityProperties.java | 149 + .../generated/models/ImageDescriptor.java | 128 + .../generated/models/ImageUpdateTrigger.java | 107 + .../models/ImportImageParameters.java | 146 + .../generated/models/ImportMode.java | 34 + .../generated/models/ImportPipeline.java | 224 ++ .../models/ImportPipelineListResult.java | 85 + .../ImportPipelineSourceProperties.java | 116 + .../generated/models/ImportPipelines.java | 142 + .../generated/models/ImportSource.java | 145 + .../models/ImportSourceCredentials.java | 82 + .../generated/models/IpRule.java | 82 + .../generated/models/KeyVaultProperties.java | 124 + .../generated/models/LogLevel.java | 43 + .../generated/models/LoggingProperties.java | 76 + .../models/LoginServerProperties.java | 57 + .../models/NetworkRuleBypassOptions.java | 34 + .../generated/models/NetworkRuleSet.java | 114 + .../generated/models/OS.java | 34 + .../generated/models/OperationDefinition.java | 54 + .../models/OperationDisplayDefinition.java | 128 + .../generated/models/OperationListResult.java | 86 + .../OperationLogSpecificationDefinition.java | 102 + ...perationMetricSpecificationDefinition.java | 180 + ...erationServiceSpecificationDefinition.java | 85 + .../generated/models/Operations.java | 31 + .../models/OverrideTaskStepProperties.java | 194 + .../generated/models/ParentProperties.java | 84 + .../generated/models/PasswordName.java | 47 + .../generated/models/PipelineOptions.java | 40 + .../generated/models/PipelineRun.java | 154 + .../models/PipelineRunListResult.java | 84 + .../generated/models/PipelineRunRequest.java | 170 + .../generated/models/PipelineRunResponse.java | 298 ++ .../models/PipelineRunSourceProperties.java | 76 + .../models/PipelineRunSourceType.java | 31 + .../models/PipelineRunTargetProperties.java | 76 + .../models/PipelineRunTargetType.java | 31 + .../generated/models/PipelineRuns.java | 142 + .../PipelineSourceTriggerDescriptor.java | 51 + .../PipelineSourceTriggerProperties.java | 56 + .../generated/models/PipelineSourceType.java | 31 + .../models/PipelineTriggerDescriptor.java | 53 + .../models/PipelineTriggerProperties.java | 53 + .../generated/models/PlatformProperties.java | 107 + .../models/PlatformUpdateParameters.java | 102 + .../generated/models/Policies.java | 140 + .../generated/models/PolicyStatus.java | 34 + .../generated/models/PrivateEndpoint.java | 51 + .../models/PrivateEndpointConnection.java | 202 + .../PrivateEndpointConnectionListResult.java | 86 + .../models/PrivateEndpointConnections.java | 142 + .../generated/models/PrivateLinkResource.java | 61 + .../models/PrivateLinkResourceListResult.java | 86 + .../PrivateLinkServiceConnectionState.java | 108 + .../generated/models/ProgressProperties.java | 50 + .../generated/models/ProvisioningState.java | 46 + .../generated/models/PublicNetworkAccess.java | 34 + .../generated/models/QuarantinePolicy.java | 50 + .../RegenerateCredentialParameters.java | 57 + .../generated/models/Registries.java | 403 ++ .../generated/models/Registry.java | 700 ++++ .../models/RegistryListCredentialsResult.java | 33 + .../generated/models/RegistryListResult.java | 86 + .../models/RegistryNameCheckRequest.java | 89 + .../generated/models/RegistryNameStatus.java | 40 + .../generated/models/RegistryPassword.java | 76 + .../models/RegistryUpdateParameters.java | 332 ++ .../generated/models/RegistryUsage.java | 128 + .../models/RegistryUsageListResult.java | 26 + .../generated/models/RegistryUsageUnit.java | 34 + .../generated/models/Replication.java | 275 ++ .../models/ReplicationListResult.java | 84 + .../models/ReplicationUpdateParameters.java | 86 + .../generated/models/Replications.java | 142 + .../generated/models/Request.java | 161 + .../models/ResourceIdentityType.java | 53 + .../generated/models/RetentionPolicy.java | 93 + .../generated/models/Run.java | 205 + .../generated/models/RunGetLogResult.java | 31 + .../generated/models/RunListResult.java | 81 + .../generated/models/RunRequest.java | 121 + .../generated/models/RunStatus.java | 52 + .../generated/models/RunType.java | 40 + .../generated/models/RunUpdateParameters.java | 50 + .../generated/models/Runs.java | 154 + .../generated/models/ScopeMap.java | 212 + .../generated/models/ScopeMapListResult.java | 84 + .../models/ScopeMapUpdateParameters.java | 83 + .../generated/models/ScopeMaps.java | 142 + .../generated/models/SecretObject.java | 85 + .../generated/models/SecretObjectType.java | 34 + .../generated/models/SetValue.java | 110 + .../generated/models/Sku.java | 69 + .../generated/models/SkuName.java | 40 + .../generated/models/SkuTier.java | 40 + .../generated/models/Source.java | 83 + .../generated/models/SourceControlType.java | 34 + .../generated/models/SourceProperties.java | 146 + .../models/SourceRegistryCredentials.java | 58 + .../models/SourceRegistryLoginMode.java | 34 + .../generated/models/SourceTrigger.java | 147 + .../models/SourceTriggerDescriptor.java | 206 + .../generated/models/SourceTriggerEvent.java | 34 + .../models/SourceTriggerUpdateParameters.java | 138 + .../models/SourceUpdateParameters.java | 136 + .../models/SourceUploadDefinition.java | 33 + .../generated/models/Status.java | 71 + .../models/StatusDetailProperties.java | 100 + .../generated/models/StepType.java | 37 + .../generated/models/SyncProperties.java | 187 + .../models/SyncUpdateProperties.java | 114 + .../generated/models/Target.java | 259 ++ .../generated/models/Task.java | 557 +++ .../generated/models/TaskListResult.java | 81 + .../generated/models/TaskRun.java | 310 ++ .../generated/models/TaskRunListResult.java | 81 + .../generated/models/TaskRunRequest.java | 113 + .../models/TaskRunUpdateParameters.java | 166 + .../generated/models/TaskRuns.java | 170 + .../generated/models/TaskStatus.java | 34 + .../generated/models/TaskStepProperties.java | 112 + .../models/TaskStepUpdateParameters.java | 93 + .../models/TaskUpdateParameters.java | 337 ++ .../generated/models/Tasks.java | 169 + .../generated/models/TimerTrigger.java | 112 + .../models/TimerTriggerDescriptor.java | 76 + .../models/TimerTriggerUpdateParameters.java | 108 + .../models/TlsCertificateProperties.java | 54 + .../generated/models/TlsProperties.java | 57 + .../generated/models/TlsStatus.java | 34 + .../generated/models/Token.java | 229 ++ .../generated/models/TokenCertificate.java | 132 + .../models/TokenCertificateName.java | 34 + .../models/TokenCredentialsProperties.java | 83 + .../generated/models/TokenListResult.java | 84 + .../generated/models/TokenPassword.java | 118 + .../generated/models/TokenPasswordName.java | 34 + .../generated/models/TokenStatus.java | 34 + .../generated/models/TokenType.java | 34 + .../models/TokenUpdateParameters.java | 108 + .../generated/models/Tokens.java | 141 + .../generated/models/TriggerProperties.java | 112 + .../generated/models/TriggerStatus.java | 34 + .../models/TriggerUpdateParameters.java | 112 + .../generated/models/TrustPolicy.java | 76 + .../generated/models/TrustPolicyType.java | 31 + .../models/UpdateTriggerPayloadType.java | 34 + .../models/UserIdentityProperties.java | 76 + .../generated/models/Variant.java | 37 + .../generated/models/VirtualNetworkRule.java | 85 + .../generated/models/Webhook.java | 414 ++ .../generated/models/WebhookAction.java | 43 + .../models/WebhookCreateParameters.java | 224 ++ .../generated/models/WebhookListResult.java | 84 + .../generated/models/WebhookStatus.java | 34 + .../models/WebhookUpdateParameters.java | 191 + .../generated/models/Webhooks.java | 225 ++ .../generated/models/ZoneRedundancy.java | 34 + .../generated/models/package-info.java | 6 + .../generated/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/containerregistry/ci.yml | 3 + sdk/containerregistry/pom.xml | 1 + 331 files changed, 64215 insertions(+) create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/CHANGELOG.md create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/README.md create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/pom.xml create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/ContainerRegistryManager.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/AgentPoolsClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ConnectedRegistriesClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ContainerRegistryManagementClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ExportPipelinesClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ImportPipelinesClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/OperationsClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PipelineRunsClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RegistriesClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ReplicationsClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RunsClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ScopeMapsClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TaskRunsClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TasksClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TokensClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/WebhooksClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolQueueStatusInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CallbackConfigInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInfoInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/GenerateCredentialsResultInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationDefinitionInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryListCredentialsResultInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryNameStatusInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryUsageListResultInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunGetLogResultInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/SourceUploadDefinitionInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/package-info.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/package-info.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolQueueStatusImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolsClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolsImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CallbackConfigImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistryImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientBuilder.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventInfoImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelineImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/GenerateCredentialsResultImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelineImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationDefinitionImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryListCredentialsResultImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryNameStatusImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryUsageListResultImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunGetLogResultImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunsClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunsImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/SourceUploadDefinitionImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunsClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunsImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TasksClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TasksImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokenImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/Utils.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhookImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/package-info.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Action.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActionsRequired.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Actor.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPool.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolQueueStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPools.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Architecture.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Argument.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuditLogStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthInfo.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthInfoUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageDependency.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageDependencyType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTrigger.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTriggerType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTriggerUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CallbackConfig.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CertificateType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistries.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistry.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryMode.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionState.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Credentials.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CustomRegistryCredentials.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DefaultAction.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerBuildRequest.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerBuildStepUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerTaskStep.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskRunRequest.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskStep.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskStepUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionProperty.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Event.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventContent.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventInfo.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventRequestMessage.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventResponseMessage.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipeline.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineTargetProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelines.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicy.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicyStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskRunRequest.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskStep.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskStepUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IdentityProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImageDescriptor.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImageUpdateTrigger.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportImageParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportMode.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipeline.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineSourceProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelines.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSource.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSourceCredentials.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IpRule.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/KeyVaultProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LogLevel.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoggingProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoginServerProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleBypassOptions.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleSet.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OS.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDefinition.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDisplayDefinition.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationLogSpecificationDefinition.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationMetricSpecificationDefinition.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationServiceSpecificationDefinition.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Operations.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OverrideTaskStepProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ParentProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PasswordName.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineOptions.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRun.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunRequest.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunResponse.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRuns.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerDescriptor.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerDescriptor.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PlatformProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PlatformUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Policies.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PolicyStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpoint.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnection.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnections.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResource.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResourceListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProgressProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProvisioningState.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PublicNetworkAccess.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/QuarantinePolicy.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegenerateCredentialParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registries.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registry.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListCredentialsResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameCheckRequest.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryPassword.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsage.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageUnit.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replication.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replications.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Request.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ResourceIdentityType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RetentionPolicy.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Run.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunGetLogResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunRequest.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Runs.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMap.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMaps.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SecretObject.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SecretObjectType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SetValue.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Sku.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuName.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuTier.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Source.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceControlType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceRegistryCredentials.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceRegistryLoginMode.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTrigger.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerDescriptor.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerEvent.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceUploadDefinition.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Status.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StatusDetailProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StepType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncUpdateProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Target.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Task.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRun.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunRequest.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRuns.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStepProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStepUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tasks.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTrigger.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTriggerDescriptor.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTriggerUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsCertificateProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Token.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificate.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificateName.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCredentialsProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPassword.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPasswordName.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tokens.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicy.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicyType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UpdateTriggerPayloadType.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UserIdentityProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Variant.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/VirtualNetworkRule.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhook.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookAction.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookCreateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhooks.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ZoneRedundancy.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/package-info.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/package-info.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/module-info.java diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 63484afdca5b3..4d233f83b0186 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -300,6 +300,7 @@ com.azure.resourcemanager:azure-resourcemanager-maps;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-botservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackup;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-deviceprovisioningservices;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-containerregistry-generated;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/CHANGELOG.md b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/CHANGELOG.md new file mode 100644 index 0000000000000..e1a3c990d459f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-06-22) + +- Azure Resource Manager ContainerRegistry client library for Java. This package contains Microsoft Azure SDK for ContainerRegistry Management SDK. Package tag package-2021-06-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/README.md b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/README.md new file mode 100644 index 0000000000000..83201cd654df4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager ContainerRegistry client library for Java + +Azure Resource Manager ContainerRegistry client library for Java. + +This package contains Microsoft Azure SDK for ContainerRegistry Management SDK. Package tag package-2021-06-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-containerregistry-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-containerregistry-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ContainerRegistryManager manager = ContainerRegistryManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/pom.xml b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/pom.xml new file mode 100644 index 0000000000000..f013598e7f5fe --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-containerregistry-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft Azure SDK for ContainerRegistry Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-06-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.17.0 + + + com.azure + azure-core-management + 1.3.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/ContainerRegistryManager.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/ContainerRegistryManager.java new file mode 100644 index 0000000000000..48b70467e23f3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/ContainerRegistryManager.java @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ContainerRegistryManagementClient; +import com.azure.resourcemanager.containerregistry.generated.implementation.AgentPoolsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ConnectedRegistriesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ContainerRegistryManagementClientBuilder; +import com.azure.resourcemanager.containerregistry.generated.implementation.ExportPipelinesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ImportPipelinesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.PipelineRunsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.RegistriesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ReplicationsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.RunsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ScopeMapsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.TaskRunsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.TasksImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.TokensImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.WebhooksImpl; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPools; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistries; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelines; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelines; +import com.azure.resourcemanager.containerregistry.generated.models.Operations; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRuns; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.containerregistry.generated.models.Registries; +import com.azure.resourcemanager.containerregistry.generated.models.Replications; +import com.azure.resourcemanager.containerregistry.generated.models.Runs; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMaps; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRuns; +import com.azure.resourcemanager.containerregistry.generated.models.Tasks; +import com.azure.resourcemanager.containerregistry.generated.models.Tokens; +import com.azure.resourcemanager.containerregistry.generated.models.Webhooks; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to ContainerRegistryManager. */ +public final class ContainerRegistryManager { + private ConnectedRegistries connectedRegistries; + + private ExportPipelines exportPipelines; + + private Registries registries; + + private ImportPipelines importPipelines; + + private Operations operations; + + private PipelineRuns pipelineRuns; + + private PrivateEndpointConnections privateEndpointConnections; + + private Replications replications; + + private ScopeMaps scopeMaps; + + private Tokens tokens; + + private Webhooks webhooks; + + private AgentPools agentPools; + + private Runs runs; + + private TaskRuns taskRuns; + + private Tasks tasks; + + private final ContainerRegistryManagementClient clientObject; + + private ContainerRegistryManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ContainerRegistryManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ContainerRegistry service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerRegistry service API instance. + */ + public static ContainerRegistryManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ContainerRegistryManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ContainerRegistry service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerRegistry service API instance. + */ + public ContainerRegistryManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.containerregistry.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ContainerRegistryManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of ConnectedRegistries. */ + public ConnectedRegistries connectedRegistries() { + if (this.connectedRegistries == null) { + this.connectedRegistries = new ConnectedRegistriesImpl(clientObject.getConnectedRegistries(), this); + } + return connectedRegistries; + } + + /** @return Resource collection API of ExportPipelines. */ + public ExportPipelines exportPipelines() { + if (this.exportPipelines == null) { + this.exportPipelines = new ExportPipelinesImpl(clientObject.getExportPipelines(), this); + } + return exportPipelines; + } + + /** @return Resource collection API of Registries. */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(clientObject.getRegistries(), this); + } + return registries; + } + + /** @return Resource collection API of ImportPipelines. */ + public ImportPipelines importPipelines() { + if (this.importPipelines == null) { + this.importPipelines = new ImportPipelinesImpl(clientObject.getImportPipelines(), this); + } + return importPipelines; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of PipelineRuns. */ + public PipelineRuns pipelineRuns() { + if (this.pipelineRuns == null) { + this.pipelineRuns = new PipelineRunsImpl(clientObject.getPipelineRuns(), this); + } + return pipelineRuns; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of Replications. */ + public Replications replications() { + if (this.replications == null) { + this.replications = new ReplicationsImpl(clientObject.getReplications(), this); + } + return replications; + } + + /** @return Resource collection API of ScopeMaps. */ + public ScopeMaps scopeMaps() { + if (this.scopeMaps == null) { + this.scopeMaps = new ScopeMapsImpl(clientObject.getScopeMaps(), this); + } + return scopeMaps; + } + + /** @return Resource collection API of Tokens. */ + public Tokens tokens() { + if (this.tokens == null) { + this.tokens = new TokensImpl(clientObject.getTokens(), this); + } + return tokens; + } + + /** @return Resource collection API of Webhooks. */ + public Webhooks webhooks() { + if (this.webhooks == null) { + this.webhooks = new WebhooksImpl(clientObject.getWebhooks(), this); + } + return webhooks; + } + + /** @return Resource collection API of AgentPools. */ + public AgentPools agentPools() { + if (this.agentPools == null) { + this.agentPools = new AgentPoolsImpl(clientObject.getAgentPools(), this); + } + return agentPools; + } + + /** @return Resource collection API of Runs. */ + public Runs runs() { + if (this.runs == null) { + this.runs = new RunsImpl(clientObject.getRuns(), this); + } + return runs; + } + + /** @return Resource collection API of TaskRuns. */ + public TaskRuns taskRuns() { + if (this.taskRuns == null) { + this.taskRuns = new TaskRunsImpl(clientObject.getTaskRuns(), this); + } + return taskRuns; + } + + /** @return Resource collection API of Tasks. */ + public Tasks tasks() { + if (this.tasks == null) { + this.tasks = new TasksImpl(clientObject.getTasks(), this); + } + return tasks; + } + + /** + * @return Wrapped service client ContainerRegistryManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public ContainerRegistryManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/AgentPoolsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/AgentPoolsClient.java new file mode 100644 index 0000000000000..8c6df16dd11d3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/AgentPoolsClient.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolQueueStatusInner; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPoolUpdateParameters; + +/** An instance of this class provides access to all the operations defined in AgentPoolsClient. */ +public interface AgentPoolsClient { + /** + * Gets the detailed information for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner get(String resourceGroupName, String registryName, String agentPoolName); + + /** + * Gets the detailed information for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String agentPoolName, Context context); + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AgentPoolInner> beginCreate( + String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool); + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AgentPoolInner> beginCreate( + String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool, Context context); + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner create( + String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool); + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner create( + String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool, Context context); + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String agentPoolName); + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String agentPoolName, Context context); + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String agentPoolName); + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String agentPoolName, Context context); + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AgentPoolInner> beginUpdate( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters); + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AgentPoolInner> beginUpdate( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters, + Context context); + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner update( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters); + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner update( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters, + Context context); + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the count of queued runs for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolQueueStatusInner getQueueStatus(String resourceGroupName, String registryName, String agentPoolName); + + /** + * Gets the count of queued runs for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getQueueStatusWithResponse( + String resourceGroupName, String registryName, String agentPoolName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ConnectedRegistriesClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ConnectedRegistriesClient.java new file mode 100644 index 0000000000000..8f0af2294f8c9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ConnectedRegistriesClient.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ConnectedRegistriesClient. */ +public interface ConnectedRegistriesClient { + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedRegistryInner get(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectedRegistryInner> beginCreate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters); + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectedRegistryInner> beginCreate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context); + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedRegistryInner create( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters); + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedRegistryInner create( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context); + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectedRegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters); + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectedRegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context); + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedRegistryInner update( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters); + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedRegistryInner update( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context); + + /** + * Lists all connected registries 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all connected registries 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 filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deactivate(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deactivate(String resourceGroupName, String registryName, String connectedRegistryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ContainerRegistryManagementClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ContainerRegistryManagementClient.java new file mode 100644 index 0000000000000..07ca795007c97 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ContainerRegistryManagementClient.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ContainerRegistryManagementClient class. */ +public interface ContainerRegistryManagementClient { + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ConnectedRegistriesClient object to access its operations. + * + * @return the ConnectedRegistriesClient object. + */ + ConnectedRegistriesClient getConnectedRegistries(); + + /** + * Gets the ExportPipelinesClient object to access its operations. + * + * @return the ExportPipelinesClient object. + */ + ExportPipelinesClient getExportPipelines(); + + /** + * Gets the RegistriesClient object to access its operations. + * + * @return the RegistriesClient object. + */ + RegistriesClient getRegistries(); + + /** + * Gets the ImportPipelinesClient object to access its operations. + * + * @return the ImportPipelinesClient object. + */ + ImportPipelinesClient getImportPipelines(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the PipelineRunsClient object to access its operations. + * + * @return the PipelineRunsClient object. + */ + PipelineRunsClient getPipelineRuns(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the ReplicationsClient object to access its operations. + * + * @return the ReplicationsClient object. + */ + ReplicationsClient getReplications(); + + /** + * Gets the ScopeMapsClient object to access its operations. + * + * @return the ScopeMapsClient object. + */ + ScopeMapsClient getScopeMaps(); + + /** + * Gets the TokensClient object to access its operations. + * + * @return the TokensClient object. + */ + TokensClient getTokens(); + + /** + * Gets the WebhooksClient object to access its operations. + * + * @return the WebhooksClient object. + */ + WebhooksClient getWebhooks(); + + /** + * Gets the AgentPoolsClient object to access its operations. + * + * @return the AgentPoolsClient object. + */ + AgentPoolsClient getAgentPools(); + + /** + * Gets the RunsClient object to access its operations. + * + * @return the RunsClient object. + */ + RunsClient getRuns(); + + /** + * Gets the TaskRunsClient object to access its operations. + * + * @return the TaskRunsClient object. + */ + TaskRunsClient getTaskRuns(); + + /** + * Gets the TasksClient object to access its operations. + * + * @return the TasksClient object. + */ + TasksClient getTasks(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ExportPipelinesClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ExportPipelinesClient.java new file mode 100644 index 0000000000000..02f7c458b3e58 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ExportPipelinesClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; + +/** An instance of this class provides access to all the operations defined in ExportPipelinesClient. */ +public interface ExportPipelinesClient { + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportPipelineInner get(String resourceGroupName, String registryName, String exportPipelineName); + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters); + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context); + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportPipelineInner create( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters); + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportPipelineInner create( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context); + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String exportPipelineName); + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String exportPipelineName); + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Lists all export pipelines 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all export pipelines 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ImportPipelinesClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ImportPipelinesClient.java new file mode 100644 index 0000000000000..938f858ecb9f2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ImportPipelinesClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; + +/** An instance of this class provides access to all the operations defined in ImportPipelinesClient. */ +public interface ImportPipelinesClient { + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImportPipelineInner get(String resourceGroupName, String registryName, String importPipelineName); + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ImportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters); + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ImportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context); + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImportPipelineInner create( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters); + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImportPipelineInner create( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context); + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String importPipelineName); + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String importPipelineName); + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Lists all import pipelines 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all import pipelines 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/OperationsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..91c3ec8fd0330 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PipelineRunsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PipelineRunsClient.java new file mode 100644 index 0000000000000..27abcbc7b7188 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PipelineRunsClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; + +/** An instance of this class provides access to all the operations defined in PipelineRunsClient. */ +public interface PipelineRunsClient { + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineRunInner get(String resourceGroupName, String registryName, String pipelineRunName); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PipelineRunInner> beginCreate( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters); + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PipelineRunInner> beginCreate( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context); + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineRunInner create( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters); + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineRunInner create( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context); + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String pipelineRunName); + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String pipelineRunName); + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Lists all the pipeline runs 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the pipeline runs 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..45c6f74de6a02 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RegistriesClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RegistriesClient.java new file mode 100644 index 0000000000000..1271ec5eb59b9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RegistriesClient.java @@ -0,0 +1,647 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.SourceUploadDefinitionInner; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameCheckRequest; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.RunRequest; + +/** An instance of this class provides access to all the operations defined in RegistriesClient. */ +public interface RegistriesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginImportImage( + String resourceGroupName, String registryName, ImportImageParameters parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginImportImage( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters, Context context); + + /** + * 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 registryNameCheckRequest The object containing information for the availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryNameStatusInner checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest); + + /** + * 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 registryNameCheckRequest The object containing information for the availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner getByResourceGroup(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RegistryInner> beginCreate( + String resourceGroupName, String registryName, RegistryInner registry); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RegistryInner> beginCreate( + String resourceGroupName, String registryName, RegistryInner registry, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RegistryInner> beginUpdate( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner update( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner update( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the container registries under the specified subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the container registries under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * 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 regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryListCredentialsResultInner regenerateCredential( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters); + + /** + * 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 regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateLinkResources(String resourceGroupName, String registryName); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GenerateCredentialsResultInner> beginGenerateCredentials( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GenerateCredentialsResultInner> beginGenerateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenerateCredentialsResultInner generateCredentials( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenerateCredentialsResultInner generateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RunInner> beginScheduleRun( + String resourceGroupName, String registryName, RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RunInner> beginScheduleRun( + String resourceGroupName, String registryName, RunRequest runRequest, Context context); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuildSourceUploadUrlWithResponse( + String resourceGroupName, String registryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ReplicationsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ReplicationsClient.java new file mode 100644 index 0000000000000..923bb100118ad --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ReplicationsClient.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import com.azure.resourcemanager.containerregistry.generated.models.ReplicationUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ReplicationsClient. */ +public interface ReplicationsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationInner get(String resourceGroupName, String registryName, String replicationName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplicationInner> beginCreate( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplicationInner> beginCreate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationInner create( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationInner create( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String replicationName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplicationInner> beginUpdate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters); + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplicationInner> beginUpdate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context); + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationInner update( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters); + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationInner update( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RunsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RunsClient.java new file mode 100644 index 0000000000000..18901f2a284fc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RunsClient.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunGetLogResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.generated.models.RunUpdateParameters; + +/** An instance of this class provides access to all the operations defined in RunsClient. */ +public interface RunsClient { + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed + * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String filter, Integer top, Context context); + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunInner get(String resourceGroupName, String registryName, String runId); + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, String runId, Context context); + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RunInner> beginUpdate( + String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters); + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RunInner> beginUpdate( + String resourceGroupName, + String registryName, + String runId, + RunUpdateParameters runUpdateParameters, + Context context); + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunInner update( + String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters); + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunInner update( + String resourceGroupName, + String registryName, + String runId, + RunUpdateParameters runUpdateParameters, + Context context); + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId); + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogSasUrlWithResponse( + String resourceGroupName, String registryName, String runId, Context context); + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginCancel(String resourceGroupName, String registryName, String runId); + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginCancel( + String resourceGroupName, String registryName, String runId, Context context); + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel(String resourceGroupName, String registryName, String runId); + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel(String resourceGroupName, String registryName, String runId, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ScopeMapsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ScopeMapsClient.java new file mode 100644 index 0000000000000..19a643e5345ce --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ScopeMapsClient.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMapUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ScopeMapsClient. */ +public interface ScopeMapsClient { + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeMapInner get(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ScopeMapInner> beginCreate( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters); + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ScopeMapInner> beginCreate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context); + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeMapInner create( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters); + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeMapInner create( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ScopeMapInner> beginUpdate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters); + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ScopeMapInner> beginUpdate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context); + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeMapInner update( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters); + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeMapInner update( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context); + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TaskRunsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TaskRunsClient.java new file mode 100644 index 0000000000000..7d0d8e8c3b987 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TaskRunsClient.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskRunInner; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRunUpdateParameters; + +/** An instance of this class provides access to all the operations defined in TaskRunsClient. */ +public interface TaskRunsClient { + /** + * Gets the detailed information for a given task run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskRunInner get(String resourceGroupName, String registryName, String taskRunName); + + /** + * Gets the detailed information for a given task run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String taskRunName, Context context); + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TaskRunInner> beginCreate( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun); + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TaskRunInner> beginCreate( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, Context context); + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskRunInner create(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun); + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskRunInner create( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, Context context); + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String taskRunName); + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String taskRunName, Context context); + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String taskRunName); + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String taskRunName, Context context); + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TaskRunInner> beginUpdate( + String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters); + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TaskRunInner> beginUpdate( + String resourceGroupName, + String registryName, + String taskRunName, + TaskRunUpdateParameters updateParameters, + Context context); + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskRunInner update( + String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters); + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskRunInner update( + String resourceGroupName, + String registryName, + String taskRunName, + TaskRunUpdateParameters updateParameters, + Context context); + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskRunInner getDetails(String resourceGroupName, String registryName, String taskRunName); + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDetailsWithResponse( + String resourceGroupName, String registryName, String taskRunName, Context context); + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TasksClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TasksClient.java new file mode 100644 index 0000000000000..85eb13cfb0955 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TasksClient.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskInner; +import com.azure.resourcemanager.containerregistry.generated.models.TaskUpdateParameters; + +/** An instance of this class provides access to all the operations defined in TasksClient. */ +public interface TasksClient { + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskInner get(String resourceGroupName, String registryName, String taskName); + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String taskName, Context context); + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TaskInner> beginCreate( + String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters); + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TaskInner> beginCreate( + String resourceGroupName, + String registryName, + String taskName, + TaskInner taskCreateParameters, + Context context); + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskInner create(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters); + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskInner create( + String resourceGroupName, + String registryName, + String taskName, + TaskInner taskCreateParameters, + Context context); + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String taskName); + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String taskName, Context context); + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String taskName); + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String taskName, Context context); + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TaskInner> beginUpdate( + String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters); + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TaskInner> beginUpdate( + String resourceGroupName, + String registryName, + String taskName, + TaskUpdateParameters taskUpdateParameters, + Context context); + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskInner update( + String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters); + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskInner update( + String resourceGroupName, + String registryName, + String taskName, + TaskUpdateParameters taskUpdateParameters, + Context context); + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskInner getDetails(String resourceGroupName, String registryName, String taskName); + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDetailsWithResponse( + String resourceGroupName, String registryName, String taskName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TokensClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TokensClient.java new file mode 100644 index 0000000000000..94cf106f136ae --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TokensClient.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import com.azure.resourcemanager.containerregistry.generated.models.TokenUpdateParameters; + +/** An instance of this class provides access to all the operations defined in TokensClient. */ +public interface TokensClient { + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInner get(String resourceGroupName, String registryName, String tokenName); + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TokenInner> beginCreate( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters); + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TokenInner> beginCreate( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context); + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInner create( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters); + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInner create( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String tokenName); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String tokenName); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TokenInner> beginUpdate( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters); + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TokenInner> beginUpdate( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context); + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInner update( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters); + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInner update( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context); + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/WebhooksClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/WebhooksClient.java new file mode 100644 index 0000000000000..0de17a2f36482 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/WebhooksClient.java @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookCreateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookUpdateParameters; + +/** An instance of this class provides access to all the operations defined in WebhooksClient. */ +public interface WebhooksClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebhookInner get(String resourceGroupName, String registryName, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WebhookInner> beginCreate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WebhookInner> beginCreate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebhookInner create( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebhookInner create( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String webhookName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String webhookName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WebhookInner> beginUpdate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WebhookInner> beginUpdate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebhookInner update( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebhookInner update( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventInfoInner ping(String resourceGroupName, String registryName, String webhookName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CallbackConfigInner getCallbackConfig(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCallbackConfigWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listEvents(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listEvents( + String resourceGroupName, String registryName, String webhookName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolInner.java new file mode 100644 index 0000000000000..d3c2deb2b18ee --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolInner.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The agentpool that has the ARM resource and properties. The agentpool will have all information to create an agent + * pool. + */ +@JsonFlatten +@Fluent +public class AgentPoolInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolInner.class); + + /* + * The count of agent machine + */ + @JsonProperty(value = "properties.count") + private Integer count; + + /* + * The Tier of agent machine + */ + @JsonProperty(value = "properties.tier") + private String tier; + + /* + * The OS of agent machine + */ + @JsonProperty(value = "properties.os") + private OS os; + + /* + * The Virtual Network Subnet Resource Id of the agent machine + */ + @JsonProperty(value = "properties.virtualNetworkSubnetResourceId") + private String virtualNetworkSubnetResourceId; + + /* + * The provisioning state of this agent pool + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the count property: The count of agent machine. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: The count of agent machine. + * + * @param count the count value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the tier property: The Tier of agent machine. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The Tier of agent machine. + * + * @param tier the tier value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the os property: The OS of agent machine. + * + * @return the os value. + */ + public OS os() { + return this.os; + } + + /** + * Set the os property: The OS of agent machine. + * + * @param os the os value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOs(OS os) { + this.os = os; + return this; + } + + /** + * Get the virtualNetworkSubnetResourceId property: The Virtual Network Subnet Resource Id of the agent machine. + * + * @return the virtualNetworkSubnetResourceId value. + */ + public String virtualNetworkSubnetResourceId() { + return this.virtualNetworkSubnetResourceId; + } + + /** + * Set the virtualNetworkSubnetResourceId property: The Virtual Network Subnet Resource Id of the agent machine. + * + * @param virtualNetworkSubnetResourceId the virtualNetworkSubnetResourceId value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withVirtualNetworkSubnetResourceId(String virtualNetworkSubnetResourceId) { + this.virtualNetworkSubnetResourceId = virtualNetworkSubnetResourceId; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of this agent pool. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public AgentPoolInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AgentPoolInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolQueueStatusInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolQueueStatusInner.java new file mode 100644 index 0000000000000..8743e21604fc9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolQueueStatusInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The QueueStatus of Agent Pool. */ +@Fluent +public final class AgentPoolQueueStatusInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolQueueStatusInner.class); + + /* + * The number of pending runs in the queue + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Get the count property: The number of pending runs in the queue. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: The number of pending runs in the queue. + * + * @param count the count value to set. + * @return the AgentPoolQueueStatusInner object itself. + */ + public AgentPoolQueueStatusInner withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CallbackConfigInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CallbackConfigInner.java new file mode 100644 index 0000000000000..488bc23712f86 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CallbackConfigInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The configuration of service URI and custom headers for the webhook. */ +@Fluent +public final class CallbackConfigInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CallbackConfigInner.class); + + /* + * 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 serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the serviceUri property: 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 the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value. + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set the customHeaders property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property serviceUri in model CallbackConfigInner")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryInner.java new file mode 100644 index 0000000000000..6be3444fba306 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryInner.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ActivationProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryMode; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectionState; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.LoginServerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ParentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.StatusDetailProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** An object that represents a connected registry for a container registry. */ +@JsonFlatten +@Fluent +public class ConnectedRegistryInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedRegistryInner.class); + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The mode of the connected registry resource that indicates the + * permissions of the registry. + */ + @JsonProperty(value = "properties.mode") + private ConnectedRegistryMode mode; + + /* + * The current version of ACR runtime on the connected registry. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The current connection state of the connected registry. + */ + @JsonProperty(value = "properties.connectionState", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionState connectionState; + + /* + * The last activity time of the connected registry. + */ + @JsonProperty(value = "properties.lastActivityTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastActivityTime; + + /* + * The activation properties of the connected registry. + */ + @JsonProperty(value = "properties.activation", access = JsonProperty.Access.WRITE_ONLY) + private ActivationProperties activation; + + /* + * The parent of the connected registry. + */ + @JsonProperty(value = "properties.parent") + private ParentProperties parent; + + /* + * The list of the ACR token resource IDs used to authenticate clients to + * the connected registry. + */ + @JsonProperty(value = "properties.clientTokenIds") + private List clientTokenIds; + + /* + * The login server properties of the connected registry. + */ + @JsonProperty(value = "properties.loginServer") + private LoginServerProperties loginServer; + + /* + * The logging properties of the connected registry. + */ + @JsonProperty(value = "properties.logging") + private LoggingProperties logging; + + /* + * The list of current statuses of the connected registry. + */ + @JsonProperty(value = "properties.statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private List statusDetails; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the mode property: The mode of the connected registry resource that indicates the permissions of the + * registry. + * + * @return the mode value. + */ + public ConnectedRegistryMode mode() { + return this.mode; + } + + /** + * Set the mode property: The mode of the connected registry resource that indicates the permissions of the + * registry. + * + * @param mode the mode value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withMode(ConnectedRegistryMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the version property: The current version of ACR runtime on the connected registry. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the connectionState property: The current connection state of the connected registry. + * + * @return the connectionState value. + */ + public ConnectionState connectionState() { + return this.connectionState; + } + + /** + * Get the lastActivityTime property: The last activity time of the connected registry. + * + * @return the lastActivityTime value. + */ + public OffsetDateTime lastActivityTime() { + return this.lastActivityTime; + } + + /** + * Get the activation property: The activation properties of the connected registry. + * + * @return the activation value. + */ + public ActivationProperties activation() { + return this.activation; + } + + /** + * Get the parent property: The parent of the connected registry. + * + * @return the parent value. + */ + public ParentProperties parent() { + return this.parent; + } + + /** + * Set the parent property: The parent of the connected registry. + * + * @param parent the parent value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withParent(ParentProperties parent) { + this.parent = parent; + return this; + } + + /** + * Get the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @return the clientTokenIds value. + */ + public List clientTokenIds() { + return this.clientTokenIds; + } + + /** + * Set the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @param clientTokenIds the clientTokenIds value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withClientTokenIds(List clientTokenIds) { + this.clientTokenIds = clientTokenIds; + return this; + } + + /** + * Get the loginServer property: The login server properties of the connected registry. + * + * @return the loginServer value. + */ + public LoginServerProperties loginServer() { + return this.loginServer; + } + + /** + * Set the loginServer property: The login server properties of the connected registry. + * + * @param loginServer the loginServer value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withLoginServer(LoginServerProperties loginServer) { + this.loginServer = loginServer; + return this; + } + + /** + * Get the logging property: The logging properties of the connected registry. + * + * @return the logging value. + */ + public LoggingProperties logging() { + return this.logging; + } + + /** + * Set the logging property: The logging properties of the connected registry. + * + * @param logging the logging value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withLogging(LoggingProperties logging) { + this.logging = logging; + return this; + } + + /** + * Get the statusDetails property: The list of current statuses of the connected registry. + * + * @return the statusDetails value. + */ + public List statusDetails() { + return this.statusDetails; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (activation() != null) { + activation().validate(); + } + if (parent() != null) { + parent().validate(); + } + if (loginServer() != null) { + loginServer().validate(); + } + if (logging() != null) { + logging().validate(); + } + if (statusDetails() != null) { + statusDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInfoInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInfoInner.java new file mode 100644 index 0000000000000..b306cf3bae05c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInfoInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The basic information of an event. */ +@Fluent +public class EventInfoInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventInfoInner.class); + + /* + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The event ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInner.java new file mode 100644 index 0000000000000..ccd620ec23a0d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.EventRequestMessage; +import com.azure.resourcemanager.containerregistry.generated.models.EventResponseMessage; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The event for a webhook. */ +@Fluent +public final class EventInner extends EventInfoInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventInner.class); + + /* + * 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 eventRequestMessage property: The event request message sent to the service URI. + * + * @return the eventRequestMessage value. + */ + public EventRequestMessage eventRequestMessage() { + return this.eventRequestMessage; + } + + /** + * Set the eventRequestMessage property: 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 eventResponseMessage property: The event response message received from the service URI. + * + * @return the eventResponseMessage value. + */ + public EventResponseMessage eventResponseMessage() { + return this.eventResponseMessage; + } + + /** + * Set the eventResponseMessage property: 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; + } + + /** {@inheritDoc} */ + @Override + public EventInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (eventRequestMessage() != null) { + eventRequestMessage().validate(); + } + if (eventResponseMessage() != null) { + eventResponseMessage().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineInner.java new file mode 100644 index 0000000000000..27fa8aa01af40 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineInner.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelineTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An object that represents an export pipeline for a container registry. */ +@JsonFlatten +@Fluent +public class ExportPipelineInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportPipelineInner.class); + + /* + * The location of the export pipeline. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The identity of the export pipeline. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The target properties of the export pipeline. + */ + @JsonProperty(value = "properties.target") + private ExportPipelineTargetProperties target; + + /* + * The list of all options configured for the pipeline. + */ + @JsonProperty(value = "properties.options") + private List options; + + /* + * The provisioning state of the pipeline at the time the operation was + * called. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the location property: The location of the export pipeline. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the export pipeline. + * + * @param location the location value to set. + * @return the ExportPipelineInner object itself. + */ + public ExportPipelineInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the identity property: The identity of the export pipeline. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the export pipeline. + * + * @param identity the identity value to set. + * @return the ExportPipelineInner object itself. + */ + public ExportPipelineInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the target property: The target properties of the export pipeline. + * + * @return the target value. + */ + public ExportPipelineTargetProperties target() { + return this.target; + } + + /** + * Set the target property: The target properties of the export pipeline. + * + * @param target the target value to set. + * @return the ExportPipelineInner object itself. + */ + public ExportPipelineInner withTarget(ExportPipelineTargetProperties target) { + this.target = target; + return this; + } + + /** + * Get the options property: The list of all options configured for the pipeline. + * + * @return the options value. + */ + public List options() { + return this.options; + } + + /** + * Set the options property: The list of all options configured for the pipeline. + * + * @param options the options value to set. + * @return the ExportPipelineInner object itself. + */ + public ExportPipelineInner withOptions(List options) { + this.options = options; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the pipeline at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (target() != null) { + target().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/GenerateCredentialsResultInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/GenerateCredentialsResultInner.java new file mode 100644 index 0000000000000..0e8de7987212f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/GenerateCredentialsResultInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.TokenPassword; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the GenerateCredentials operation. */ +@Fluent +public final class GenerateCredentialsResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenerateCredentialsResultInner.class); + + /* + * 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 property: The username for a container registry. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username for a container registry. + * + * @param username the username value to set. + * @return the GenerateCredentialsResultInner object itself. + */ + public GenerateCredentialsResultInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the passwords property: The list of passwords for a container registry. + * + * @return the passwords value. + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the passwords property: The list of passwords for a container registry. + * + * @param passwords the passwords value to set. + * @return the GenerateCredentialsResultInner object itself. + */ + public GenerateCredentialsResultInner withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (passwords() != null) { + passwords().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineInner.java new file mode 100644 index 0000000000000..4e6049b3fb389 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineInner.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelineSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineTriggerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An object that represents an import pipeline for a container registry. */ +@JsonFlatten +@Fluent +public class ImportPipelineInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImportPipelineInner.class); + + /* + * The location of the import pipeline. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The identity of the import pipeline. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The source properties of the import pipeline. + */ + @JsonProperty(value = "properties.source") + private ImportPipelineSourceProperties source; + + /* + * The properties that describe the trigger of the import pipeline. + */ + @JsonProperty(value = "properties.trigger") + private PipelineTriggerProperties trigger; + + /* + * The list of all options configured for the pipeline. + */ + @JsonProperty(value = "properties.options") + private List options; + + /* + * The provisioning state of the pipeline at the time the operation was + * called. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the location property: The location of the import pipeline. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the import pipeline. + * + * @param location the location value to set. + * @return the ImportPipelineInner object itself. + */ + public ImportPipelineInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the identity property: The identity of the import pipeline. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the import pipeline. + * + * @param identity the identity value to set. + * @return the ImportPipelineInner object itself. + */ + public ImportPipelineInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the source property: The source properties of the import pipeline. + * + * @return the source value. + */ + public ImportPipelineSourceProperties source() { + return this.source; + } + + /** + * Set the source property: The source properties of the import pipeline. + * + * @param source the source value to set. + * @return the ImportPipelineInner object itself. + */ + public ImportPipelineInner withSource(ImportPipelineSourceProperties source) { + this.source = source; + return this; + } + + /** + * Get the trigger property: The properties that describe the trigger of the import pipeline. + * + * @return the trigger value. + */ + public PipelineTriggerProperties trigger() { + return this.trigger; + } + + /** + * Set the trigger property: The properties that describe the trigger of the import pipeline. + * + * @param trigger the trigger value to set. + * @return the ImportPipelineInner object itself. + */ + public ImportPipelineInner withTrigger(PipelineTriggerProperties trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the options property: The list of all options configured for the pipeline. + * + * @return the options value. + */ + public List options() { + return this.options; + } + + /** + * Set the options property: The list of all options configured for the pipeline. + * + * @param options the options value to set. + * @return the ImportPipelineInner object itself. + */ + public ImportPipelineInner withOptions(List options) { + this.options = options; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the pipeline at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (source() != null) { + source().validate(); + } + if (trigger() != null) { + trigger().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationDefinitionInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationDefinitionInner.java new file mode 100644 index 0000000000000..740d1edbc5151 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationDefinitionInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.OperationDisplayDefinition; +import com.azure.resourcemanager.containerregistry.generated.models.OperationServiceSpecificationDefinition; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of a container registry operation. */ +@JsonFlatten +@Fluent +public class OperationDefinitionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDefinitionInner.class); + + /* + * The origin information of the container registry operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display information for the container registry operation. + */ + @JsonProperty(value = "display") + private OperationDisplayDefinition display; + + /* + * This property indicates if the operation is an action or a data action + * ref: + * https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * The definition of Azure Monitoring service. + */ + @JsonProperty(value = "properties.serviceSpecification") + private OperationServiceSpecificationDefinition serviceSpecification; + + /** + * Get the origin property: The origin information of the container registry operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The origin information of the container registry operation. + * + * @param origin the origin value to set. + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 property: The display information for the container registry operation. + * + * @return the display value. + */ + public OperationDisplayDefinition display() { + return this.display; + } + + /** + * Set the display property: The display information for the container registry operation. + * + * @param display the display value to set. + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withDisplay(OperationDisplayDefinition display) { + this.display = display; + return this; + } + + /** + * Get the isDataAction property: This property indicates if the operation is an action or a data action ref: + * https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: This property indicates if the operation is an action or a data action ref: + * https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the serviceSpecification property: The definition of Azure Monitoring service. + * + * @return the serviceSpecification value. + */ + public OperationServiceSpecificationDefinition serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: The definition of Azure Monitoring service. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withServiceSpecification( + OperationServiceSpecificationDefinition serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunInner.java new file mode 100644 index 0000000000000..4493a10b5b143 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunInner.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunResponse; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that represents a pipeline run for a container registry. */ +@JsonFlatten +@Fluent +public class PipelineRunInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineRunInner.class); + + /* + * The provisioning state of a pipeline run. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The request parameters for a pipeline run. + */ + @JsonProperty(value = "properties.request") + private PipelineRunRequest request; + + /* + * The response of a pipeline run. + */ + @JsonProperty(value = "properties.response", access = JsonProperty.Access.WRITE_ONLY) + private PipelineRunResponse response; + + /* + * How the pipeline run should be forced to recreate even if the pipeline + * run configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the provisioningState property: The provisioning state of a pipeline run. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the request property: The request parameters for a pipeline run. + * + * @return the request value. + */ + public PipelineRunRequest request() { + return this.request; + } + + /** + * Set the request property: The request parameters for a pipeline run. + * + * @param request the request value to set. + * @return the PipelineRunInner object itself. + */ + public PipelineRunInner withRequest(PipelineRunRequest request) { + this.request = request; + return this; + } + + /** + * Get the response property: The response of a pipeline run. + * + * @return the response value. + */ + public PipelineRunResponse response() { + return this.response; + } + + /** + * Get the forceUpdateTag property: How the pipeline run should be forced to recreate even if the pipeline run + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the pipeline run should be forced to recreate even if the pipeline run + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the PipelineRunInner object itself. + */ + public PipelineRunInner withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (request() != null) { + request().validate(); + } + if (response() != null) { + response().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..a8b9ce0539a22 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that represents a private endpoint connection for a container registry. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * The resource of private endpoint. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of private endpoint connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private endpoint. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of private endpoint connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..0b60bced8f9a9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A resource that supports private link capabilities. */ +@JsonFlatten +@Fluent +public class PrivateLinkResourceInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); + + /* + * The resource type is private link resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId") + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers") + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the type property: The resource type is private link resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the id property: The resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource ID. + * + * @param id the id value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource. + * + * @param name the name value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The private link resource group id. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers property: The private link resource required member names. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryInner.java new file mode 100644 index 0000000000000..25ee2f6675b49 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryInner.java @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.EncryptionProperty; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleBypassOptions; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.containerregistry.generated.models.Policies; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An object that represents a container registry. */ +@JsonFlatten +@Fluent +public class RegistryInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryInner.class); + + /* + * The SKU of the container registry. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * The identity of the container registry. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The URL that can be used to log into the container registry. + */ + @JsonProperty(value = "properties.loginServer", access = JsonProperty.Access.WRITE_ONLY) + private String loginServer; + + /* + * The creation date of the container registry in ISO8601 format. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * The provisioning state of the container registry at the time the + * operation was called. + */ + @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 network rule set for a container registry. + */ + @JsonProperty(value = "properties.networkRuleSet") + private NetworkRuleSet networkRuleSet; + + /* + * The policies for a container registry. + */ + @JsonProperty(value = "properties.policies") + private Policies policies; + + /* + * The encryption settings of container registry. + */ + @JsonProperty(value = "properties.encryption") + private EncryptionProperty encryption; + + /* + * Enable a single data endpoint per region for serving data. + */ + @JsonProperty(value = "properties.dataEndpointEnabled") + private Boolean dataEndpointEnabled; + + /* + * List of host names that will serve data when dataEndpointEnabled is + * true. + */ + @JsonProperty(value = "properties.dataEndpointHostNames", access = JsonProperty.Access.WRITE_ONLY) + private List dataEndpointHostNames; + + /* + * List of private endpoint connections for a container registry. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Whether or not public network access is allowed for the container + * registry. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Whether to allow trusted Azure services to access a network restricted + * registry. + */ + @JsonProperty(value = "properties.networkRuleBypassOptions") + private NetworkRuleBypassOptions networkRuleBypassOptions; + + /* + * Whether or not zone redundancy is enabled for this container registry + */ + @JsonProperty(value = "properties.zoneRedundancy") + private ZoneRedundancy zoneRedundancy; + + /* + * Enables registry-wide pull from unauthenticated clients. + */ + @JsonProperty(value = "properties.anonymousPullEnabled") + private Boolean anonymousPullEnabled; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the sku property: The SKU of the container registry. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the container registry. + * + * @param sku the sku value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: The identity of the container registry. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the container registry. + * + * @param identity the identity value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the loginServer property: The URL that can be used to log into the container registry. + * + * @return the loginServer value. + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Get the creationDate property: The creation date of the container registry in ISO8601 format. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioningState property: The provisioning state of the container registry at the time the operation + * was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: 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 adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value. + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the adminUserEnabled property: 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 networkRuleSet property: The network rule set for a container registry. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set the networkRuleSet property: The network rule set for a container registry. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the policies property: The policies for a container registry. + * + * @return the policies value. + */ + public Policies policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for a container registry. + * + * @param policies the policies value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withPolicies(Policies policies) { + this.policies = policies; + return this; + } + + /** + * Get the encryption property: The encryption settings of container registry. + * + * @return the encryption value. + */ + public EncryptionProperty encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption settings of container registry. + * + * @param encryption the encryption value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withEncryption(EncryptionProperty encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @return the dataEndpointEnabled value. + */ + public Boolean dataEndpointEnabled() { + return this.dataEndpointEnabled; + } + + /** + * Set the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @param dataEndpointEnabled the dataEndpointEnabled value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withDataEndpointEnabled(Boolean dataEndpointEnabled) { + this.dataEndpointEnabled = dataEndpointEnabled; + return this; + } + + /** + * Get the dataEndpointHostNames property: List of host names that will serve data when dataEndpointEnabled is true. + * + * @return the dataEndpointHostNames value. + */ + public List dataEndpointHostNames() { + return this.dataEndpointHostNames; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections for a container registry. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @return the networkRuleBypassOptions value. + */ + public NetworkRuleBypassOptions networkRuleBypassOptions() { + return this.networkRuleBypassOptions; + } + + /** + * Set the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @param networkRuleBypassOptions the networkRuleBypassOptions value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions) { + this.networkRuleBypassOptions = networkRuleBypassOptions; + return this; + } + + /** + * Get the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry. + * + * @return the zoneRedundancy value. + */ + public ZoneRedundancy zoneRedundancy() { + return this.zoneRedundancy; + } + + /** + * Set the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry. + * + * @param zoneRedundancy the zoneRedundancy value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + this.zoneRedundancy = zoneRedundancy; + return this; + } + + /** + * Get the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @return the anonymousPullEnabled value. + */ + public Boolean anonymousPullEnabled() { + return this.anonymousPullEnabled; + } + + /** + * Set the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @param anonymousPullEnabled the anonymousPullEnabled value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withAnonymousPullEnabled(Boolean anonymousPullEnabled) { + this.anonymousPullEnabled = anonymousPullEnabled; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public RegistryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RegistryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model RegistryInner")); + } else { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (status() != null) { + status().validate(); + } + if (networkRuleSet() != null) { + networkRuleSet().validate(); + } + if (policies() != null) { + policies().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryListCredentialsResultInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryListCredentialsResultInner.java new file mode 100644 index 0000000000000..214774300ebf7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryListCredentialsResultInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryPassword; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the ListCredentials operation. */ +@Fluent +public final class RegistryListCredentialsResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryListCredentialsResultInner.class); + + /* + * 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 property: The username for a container registry. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: 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 passwords property: The list of passwords for a container registry. + * + * @return the passwords value. + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the passwords property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (passwords() != null) { + passwords().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryNameStatusInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryNameStatusInner.java new file mode 100644 index 0000000000000..d53a5cc678d0b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryNameStatusInner.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The result of a request to check the availability of a container registry name. */ +@Fluent +public final class RegistryNameStatusInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryNameStatusInner.class); + + /* + * 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 nameAvailable property: The value that indicates whether the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: 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 the reason property: If any, the reason that the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: 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 the message property: 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 the message property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryUsageListResultInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryUsageListResultInner.java new file mode 100644 index 0000000000000..fffcf90e081be --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryUsageListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUsage; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to get container registry quota usages. */ +@Fluent +public final class RegistryUsageListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryUsageListResultInner.class); + + /* + * The list of container registry quota usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of container registry quota usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationInner.java new file mode 100644 index 0000000000000..a32f2c55e0a5a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationInner.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An object that represents a replication for a container registry. */ +@JsonFlatten +@Fluent +public class ReplicationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationInner.class); + + /* + * The provisioning state of the replication at the time the operation was + * called. + */ + @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; + + /* + * Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is + * disabled, however its data will continue to be synced with other + * replications. + */ + @JsonProperty(value = "properties.regionEndpointEnabled") + private Boolean regionEndpointEnabled; + + /* + * Whether or not zone redundancy is enabled for this container registry + * replication + */ + @JsonProperty(value = "properties.zoneRedundancy") + private ZoneRedundancy zoneRedundancy; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the provisioningState property: The provisioning state of the replication at the time the operation was + * called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: The status of the replication at the time the operation was called. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @return the regionEndpointEnabled value. + */ + public Boolean regionEndpointEnabled() { + return this.regionEndpointEnabled; + } + + /** + * Set the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @param regionEndpointEnabled the regionEndpointEnabled value to set. + * @return the ReplicationInner object itself. + */ + public ReplicationInner withRegionEndpointEnabled(Boolean regionEndpointEnabled) { + this.regionEndpointEnabled = regionEndpointEnabled; + return this; + } + + /** + * Get the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry + * replication. + * + * @return the zoneRedundancy value. + */ + public ZoneRedundancy zoneRedundancy() { + return this.zoneRedundancy; + } + + /** + * Set the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry + * replication. + * + * @param zoneRedundancy the zoneRedundancy value to set. + * @return the ReplicationInner object itself. + */ + public ReplicationInner withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + this.zoneRedundancy = zoneRedundancy; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ReplicationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ReplicationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunGetLogResultInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunGetLogResultInner.java new file mode 100644 index 0000000000000..0c270f22641d9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunGetLogResultInner.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The result of get log link operation. */ +@Fluent +public final class RunGetLogResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunGetLogResultInner.class); + + /* + * The link to logs for a run on a azure container registry. + */ + @JsonProperty(value = "logLink") + private String logLink; + + /* + * The link to logs in registry for a run on a azure container registry. + */ + @JsonProperty(value = "logArtifactLink") + private String logArtifactLink; + + /** + * Get the logLink property: The link to logs for a run on a azure container registry. + * + * @return the logLink value. + */ + public String logLink() { + return this.logLink; + } + + /** + * Set the logLink property: The link to logs for a run on a azure container registry. + * + * @param logLink the logLink value to set. + * @return the RunGetLogResultInner object itself. + */ + public RunGetLogResultInner withLogLink(String logLink) { + this.logLink = logLink; + return this; + } + + /** + * Get the logArtifactLink property: The link to logs in registry for a run on a azure container registry. + * + * @return the logArtifactLink value. + */ + public String logArtifactLink() { + return this.logArtifactLink; + } + + /** + * Set the logArtifactLink property: The link to logs in registry for a run on a azure container registry. + * + * @param logArtifactLink the logArtifactLink value to set. + * @return the RunGetLogResultInner object itself. + */ + public RunGetLogResultInner withLogArtifactLink(String logArtifactLink) { + this.logArtifactLink = logArtifactLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunInner.java new file mode 100644 index 0000000000000..63cc7859fadd0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunInner.java @@ -0,0 +1,635 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ImageDescriptor; +import com.azure.resourcemanager.containerregistry.generated.models.ImageUpdateTrigger; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.RunStatus; +import com.azure.resourcemanager.containerregistry.generated.models.RunType; +import com.azure.resourcemanager.containerregistry.generated.models.SourceTriggerDescriptor; +import com.azure.resourcemanager.containerregistry.generated.models.TimerTriggerDescriptor; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Run resource properties. */ +@JsonFlatten +@Fluent +public class RunInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunInner.class); + + /* + * The unique identifier for the run. + */ + @JsonProperty(value = "properties.runId") + private String runId; + + /* + * The current status of the run. + */ + @JsonProperty(value = "properties.status") + private RunStatus status; + + /* + * The last updated time for the run. + */ + @JsonProperty(value = "properties.lastUpdatedTime") + private OffsetDateTime lastUpdatedTime; + + /* + * The type of run. + */ + @JsonProperty(value = "properties.runType") + private RunType runType; + + /* + * The dedicated agent pool for the run. + */ + @JsonProperty(value = "properties.agentPoolName") + private String agentPoolName; + + /* + * The time the run was scheduled. + */ + @JsonProperty(value = "properties.createTime") + private OffsetDateTime createTime; + + /* + * The time the run started. + */ + @JsonProperty(value = "properties.startTime") + private OffsetDateTime startTime; + + /* + * The time the run finished. + */ + @JsonProperty(value = "properties.finishTime") + private OffsetDateTime finishTime; + + /* + * The list of all images that were generated from the run. This is + * applicable if the run generates base image dependencies. + */ + @JsonProperty(value = "properties.outputImages") + private List outputImages; + + /* + * The task against which run was scheduled. + */ + @JsonProperty(value = "properties.task") + private String task; + + /* + * The image update trigger that caused the run. This is applicable if the + * task has base image trigger configured. + */ + @JsonProperty(value = "properties.imageUpdateTrigger") + private ImageUpdateTrigger imageUpdateTrigger; + + /* + * The source trigger that caused the run. + */ + @JsonProperty(value = "properties.sourceTrigger") + private SourceTriggerDescriptor sourceTrigger; + + /* + * The timer trigger that caused the run. + */ + @JsonProperty(value = "properties.timerTrigger") + private TimerTriggerDescriptor timerTrigger; + + /* + * The platform properties against which the run will happen. + */ + @JsonProperty(value = "properties.platform") + private PlatformProperties platform; + + /* + * The machine configuration of the run agent. + */ + @JsonProperty(value = "properties.agentConfiguration") + private AgentProperties agentConfiguration; + + /* + * The scope of the credentials that were used to login to the source + * registry during this run. + */ + @JsonProperty(value = "properties.sourceRegistryAuth") + private String sourceRegistryAuth; + + /* + * The list of custom registries that were logged in during this run. + */ + @JsonProperty(value = "properties.customRegistries") + private List customRegistries; + + /* + * The error message received from backend systems after the run is + * scheduled. + */ + @JsonProperty(value = "properties.runErrorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String runErrorMessage; + + /* + * The update trigger token passed for the Run. + */ + @JsonProperty(value = "properties.updateTriggerToken") + private String updateTriggerToken; + + /* + * The image description for the log artifact. + */ + @JsonProperty(value = "properties.logArtifact", access = JsonProperty.Access.WRITE_ONLY) + private ImageDescriptor logArtifact; + + /* + * The provisioning state of a run. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /* + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "properties.isArchiveEnabled") + private Boolean isArchiveEnabled; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the runId property: The unique identifier for the run. + * + * @return the runId value. + */ + public String runId() { + return this.runId; + } + + /** + * Set the runId property: The unique identifier for the run. + * + * @param runId the runId value to set. + * @return the RunInner object itself. + */ + public RunInner withRunId(String runId) { + this.runId = runId; + return this; + } + + /** + * Get the status property: The current status of the run. + * + * @return the status value. + */ + public RunStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of the run. + * + * @param status the status value to set. + * @return the RunInner object itself. + */ + public RunInner withStatus(RunStatus status) { + this.status = status; + return this; + } + + /** + * Get the lastUpdatedTime property: The last updated time for the run. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the lastUpdatedTime property: The last updated time for the run. + * + * @param lastUpdatedTime the lastUpdatedTime value to set. + * @return the RunInner object itself. + */ + public RunInner withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the runType property: The type of run. + * + * @return the runType value. + */ + public RunType runType() { + return this.runType; + } + + /** + * Set the runType property: The type of run. + * + * @param runType the runType value to set. + * @return the RunInner object itself. + */ + public RunInner withRunType(RunType runType) { + this.runType = runType; + return this; + } + + /** + * Get the agentPoolName property: The dedicated agent pool for the run. + * + * @return the agentPoolName value. + */ + public String agentPoolName() { + return this.agentPoolName; + } + + /** + * Set the agentPoolName property: The dedicated agent pool for the run. + * + * @param agentPoolName the agentPoolName value to set. + * @return the RunInner object itself. + */ + public RunInner withAgentPoolName(String agentPoolName) { + this.agentPoolName = agentPoolName; + return this; + } + + /** + * Get the createTime property: The time the run was scheduled. + * + * @return the createTime value. + */ + public OffsetDateTime createTime() { + return this.createTime; + } + + /** + * Set the createTime property: The time the run was scheduled. + * + * @param createTime the createTime value to set. + * @return the RunInner object itself. + */ + public RunInner withCreateTime(OffsetDateTime createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get the startTime property: The time the run started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The time the run started. + * + * @param startTime the startTime value to set. + * @return the RunInner object itself. + */ + public RunInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the finishTime property: The time the run finished. + * + * @return the finishTime value. + */ + public OffsetDateTime finishTime() { + return this.finishTime; + } + + /** + * Set the finishTime property: The time the run finished. + * + * @param finishTime the finishTime value to set. + * @return the RunInner object itself. + */ + public RunInner withFinishTime(OffsetDateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the outputImages property: The list of all images that were generated from the run. This is applicable if the + * run generates base image dependencies. + * + * @return the outputImages value. + */ + public List outputImages() { + return this.outputImages; + } + + /** + * Set the outputImages property: The list of all images that were generated from the run. This is applicable if the + * run generates base image dependencies. + * + * @param outputImages the outputImages value to set. + * @return the RunInner object itself. + */ + public RunInner withOutputImages(List outputImages) { + this.outputImages = outputImages; + return this; + } + + /** + * Get the task property: The task against which run was scheduled. + * + * @return the task value. + */ + public String task() { + return this.task; + } + + /** + * Set the task property: The task against which run was scheduled. + * + * @param task the task value to set. + * @return the RunInner object itself. + */ + public RunInner withTask(String task) { + this.task = task; + return this; + } + + /** + * Get the imageUpdateTrigger property: The image update trigger that caused the run. This is applicable if the task + * has base image trigger configured. + * + * @return the imageUpdateTrigger value. + */ + public ImageUpdateTrigger imageUpdateTrigger() { + return this.imageUpdateTrigger; + } + + /** + * Set the imageUpdateTrigger property: The image update trigger that caused the run. This is applicable if the task + * has base image trigger configured. + * + * @param imageUpdateTrigger the imageUpdateTrigger value to set. + * @return the RunInner object itself. + */ + public RunInner withImageUpdateTrigger(ImageUpdateTrigger imageUpdateTrigger) { + this.imageUpdateTrigger = imageUpdateTrigger; + return this; + } + + /** + * Get the sourceTrigger property: The source trigger that caused the run. + * + * @return the sourceTrigger value. + */ + public SourceTriggerDescriptor sourceTrigger() { + return this.sourceTrigger; + } + + /** + * Set the sourceTrigger property: The source trigger that caused the run. + * + * @param sourceTrigger the sourceTrigger value to set. + * @return the RunInner object itself. + */ + public RunInner withSourceTrigger(SourceTriggerDescriptor sourceTrigger) { + this.sourceTrigger = sourceTrigger; + return this; + } + + /** + * Get the timerTrigger property: The timer trigger that caused the run. + * + * @return the timerTrigger value. + */ + public TimerTriggerDescriptor timerTrigger() { + return this.timerTrigger; + } + + /** + * Set the timerTrigger property: The timer trigger that caused the run. + * + * @param timerTrigger the timerTrigger value to set. + * @return the RunInner object itself. + */ + public RunInner withTimerTrigger(TimerTriggerDescriptor timerTrigger) { + this.timerTrigger = timerTrigger; + return this; + } + + /** + * Get the platform property: The platform properties against which the run will happen. + * + * @return the platform value. + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform property: The platform properties against which the run will happen. + * + * @param platform the platform value to set. + * @return the RunInner object itself. + */ + public RunInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the agentConfiguration property: The machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set. + * @return the RunInner object itself. + */ + public RunInner withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the sourceRegistryAuth property: The scope of the credentials that were used to login to the source registry + * during this run. + * + * @return the sourceRegistryAuth value. + */ + public String sourceRegistryAuth() { + return this.sourceRegistryAuth; + } + + /** + * Set the sourceRegistryAuth property: The scope of the credentials that were used to login to the source registry + * during this run. + * + * @param sourceRegistryAuth the sourceRegistryAuth value to set. + * @return the RunInner object itself. + */ + public RunInner withSourceRegistryAuth(String sourceRegistryAuth) { + this.sourceRegistryAuth = sourceRegistryAuth; + return this; + } + + /** + * Get the customRegistries property: The list of custom registries that were logged in during this run. + * + * @return the customRegistries value. + */ + public List customRegistries() { + return this.customRegistries; + } + + /** + * Set the customRegistries property: The list of custom registries that were logged in during this run. + * + * @param customRegistries the customRegistries value to set. + * @return the RunInner object itself. + */ + public RunInner withCustomRegistries(List customRegistries) { + this.customRegistries = customRegistries; + return this; + } + + /** + * Get the runErrorMessage property: The error message received from backend systems after the run is scheduled. + * + * @return the runErrorMessage value. + */ + public String runErrorMessage() { + return this.runErrorMessage; + } + + /** + * Get the updateTriggerToken property: The update trigger token passed for the Run. + * + * @return the updateTriggerToken value. + */ + public String updateTriggerToken() { + return this.updateTriggerToken; + } + + /** + * Set the updateTriggerToken property: The update trigger token passed for the Run. + * + * @param updateTriggerToken the updateTriggerToken value to set. + * @return the RunInner object itself. + */ + public RunInner withUpdateTriggerToken(String updateTriggerToken) { + this.updateTriggerToken = updateTriggerToken; + return this; + } + + /** + * Get the logArtifact property: The image description for the log artifact. + * + * @return the logArtifact value. + */ + public ImageDescriptor logArtifact() { + return this.logArtifact; + } + + /** + * Get the provisioningState property: The provisioning state of a run. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of a run. + * + * @param provisioningState the provisioningState value to set. + * @return the RunInner object itself. + */ + public RunInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value. + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set. + * @return the RunInner object itself. + */ + public RunInner withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (outputImages() != null) { + outputImages().forEach(e -> e.validate()); + } + if (imageUpdateTrigger() != null) { + imageUpdateTrigger().validate(); + } + if (sourceTrigger() != null) { + sourceTrigger().validate(); + } + if (timerTrigger() != null) { + timerTrigger().validate(); + } + if (platform() != null) { + platform().validate(); + } + if (agentConfiguration() != null) { + agentConfiguration().validate(); + } + if (logArtifact() != null) { + logArtifact().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapInner.java new file mode 100644 index 0000000000000..6f7f96a5d88a2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapInner.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** An object that represents a scope map for a container registry. */ +@JsonFlatten +@Fluent +public class ScopeMapInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScopeMapInner.class); + + /* + * The user friendly description of the scope map. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The type of the scope map. E.g. BuildIn scope map. + */ + @JsonProperty(value = "properties.type", access = JsonProperty.Access.WRITE_ONLY) + private String typePropertiesType; + + /* + * The creation date of scope map. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The list of scoped permissions for registry artifacts. + * E.g. repositories/repository-name/content/read, + * repositories/repository-name/metadata/write + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the description property: The user friendly description of the scope map. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The user friendly description of the scope map. + * + * @param description the description value to set. + * @return the ScopeMapInner object itself. + */ + public ScopeMapInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the typePropertiesType property: The type of the scope map. E.g. BuildIn scope map. + * + * @return the typePropertiesType value. + */ + public String typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Get the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the actions property: The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * + * @param actions the actions value to set. + * @return the ScopeMapInner object itself. + */ + public ScopeMapInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/SourceUploadDefinitionInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/SourceUploadDefinitionInner.java new file mode 100644 index 0000000000000..f158587e98931 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/SourceUploadDefinitionInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a response to source upload request. */ +@Fluent +public final class SourceUploadDefinitionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceUploadDefinitionInner.class); + + /* + * The URL where the client can upload the source. + */ + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + /* + * The relative path to the source. This is used to submit the subsequent + * queue build request. + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /** + * Get the uploadUrl property: The URL where the client can upload the source. + * + * @return the uploadUrl value. + */ + public String uploadUrl() { + return this.uploadUrl; + } + + /** + * Set the uploadUrl property: 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 relativePath property: 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 relativePath property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskInner.java new file mode 100644 index 0000000000000..4f85a101c8ffb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskInner.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStatus; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStepProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TriggerProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * The task that has the ARM resource and task properties. The task will have all information to schedule a run against + * it. + */ +@JsonFlatten +@Fluent +public class TaskInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskInner.class); + + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The provisioning state of the task. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The creation date of task. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * The current status of task. + */ + @JsonProperty(value = "properties.status") + private TaskStatus status; + + /* + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "properties.platform") + private PlatformProperties platform; + + /* + * The machine configuration of the run agent. + */ + @JsonProperty(value = "properties.agentConfiguration") + private AgentProperties agentConfiguration; + + /* + * The dedicated agent pool for the task. + */ + @JsonProperty(value = "properties.agentPoolName") + private String agentPoolName; + + /* + * Run timeout in seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /* + * The properties of a task step. + */ + @JsonProperty(value = "properties.step") + private TaskStepProperties step; + + /* + * The properties that describe all triggers for the task. + */ + @JsonProperty(value = "properties.trigger") + private TriggerProperties trigger; + + /* + * The properties that describes a set of credentials that will be used + * when this run is invoked. + */ + @JsonProperty(value = "properties.credentials") + private Credentials credentials; + + /* + * The template that describes the repository and tag information for run + * log artifact. + */ + @JsonProperty(value = "properties.logTemplate") + private String logTemplate; + + /* + * The value of this property indicates whether the task resource is system + * task or not. + */ + @JsonProperty(value = "properties.isSystemTask") + private Boolean isSystemTask; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the TaskInner object itself. + */ + public TaskInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the task. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the creationDate property: The creation date of task. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the status property: The current status of task. + * + * @return the status value. + */ + public TaskStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of task. + * + * @param status the status value to set. + * @return the TaskInner object itself. + */ + public TaskInner withStatus(TaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the platform property: The platform properties against which the run has to happen. + * + * @return the platform value. + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform property: The platform properties against which the run has to happen. + * + * @param platform the platform value to set. + * @return the TaskInner object itself. + */ + public TaskInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the agentConfiguration property: The machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set. + * @return the TaskInner object itself. + */ + public TaskInner withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the agentPoolName property: The dedicated agent pool for the task. + * + * @return the agentPoolName value. + */ + public String agentPoolName() { + return this.agentPoolName; + } + + /** + * Set the agentPoolName property: The dedicated agent pool for the task. + * + * @param agentPoolName the agentPoolName value to set. + * @return the TaskInner object itself. + */ + public TaskInner withAgentPoolName(String agentPoolName) { + this.agentPoolName = agentPoolName; + return this; + } + + /** + * Get the timeout property: Run timeout in seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: Run timeout in seconds. + * + * @param timeout the timeout value to set. + * @return the TaskInner object itself. + */ + public TaskInner withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the step property: The properties of a task step. + * + * @return the step value. + */ + public TaskStepProperties step() { + return this.step; + } + + /** + * Set the step property: The properties of a task step. + * + * @param step the step value to set. + * @return the TaskInner object itself. + */ + public TaskInner withStep(TaskStepProperties step) { + this.step = step; + return this; + } + + /** + * Get the trigger property: The properties that describe all triggers for the task. + * + * @return the trigger value. + */ + public TriggerProperties trigger() { + return this.trigger; + } + + /** + * Set the trigger property: The properties that describe all triggers for the task. + * + * @param trigger the trigger value to set. + * @return the TaskInner object itself. + */ + public TaskInner withTrigger(TriggerProperties trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the credentials property: The properties that describes a set of credentials that will be used when this run + * is invoked. + * + * @return the credentials value. + */ + public Credentials credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The properties that describes a set of credentials that will be used when this run + * is invoked. + * + * @param credentials the credentials value to set. + * @return the TaskInner object itself. + */ + public TaskInner withCredentials(Credentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the logTemplate property: The template that describes the repository and tag information for run log + * artifact. + * + * @return the logTemplate value. + */ + public String logTemplate() { + return this.logTemplate; + } + + /** + * Set the logTemplate property: The template that describes the repository and tag information for run log + * artifact. + * + * @param logTemplate the logTemplate value to set. + * @return the TaskInner object itself. + */ + public TaskInner withLogTemplate(String logTemplate) { + this.logTemplate = logTemplate; + return this; + } + + /** + * Get the isSystemTask property: The value of this property indicates whether the task resource is system task or + * not. + * + * @return the isSystemTask value. + */ + public Boolean isSystemTask() { + return this.isSystemTask; + } + + /** + * Set the isSystemTask property: The value of this property indicates whether the task resource is system task or + * not. + * + * @param isSystemTask the isSystemTask value to set. + * @return the TaskInner object itself. + */ + public TaskInner withIsSystemTask(Boolean isSystemTask) { + this.isSystemTask = isSystemTask; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public TaskInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public TaskInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (platform() != null) { + platform().validate(); + } + if (agentConfiguration() != null) { + agentConfiguration().validate(); + } + if (step() != null) { + step().validate(); + } + if (trigger() != null) { + trigger().validate(); + } + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunInner.java new file mode 100644 index 0000000000000..3a9de7082b97c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.RunRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The task run that has the ARM resource and properties. The task run will have the information of request and result + * of a run. + */ +@JsonFlatten +@Fluent +public class TaskRunInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskRunInner.class); + + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The location of the resource + */ + @JsonProperty(value = "location") + private String location; + + /* + * The provisioning state of this task run + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The request (parameters) for the run + */ + @JsonProperty(value = "properties.runRequest") + private RunRequest runRequest; + + /* + * The result of this task run + */ + @JsonProperty(value = "properties.runResult", access = JsonProperty.Access.WRITE_ONLY) + private RunInner runResult; + + /* + * How the run should be forced to rerun even if the run request + * configuration has not changed + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the TaskRunInner object itself. + */ + public TaskRunInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the location property: The location of the resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the resource. + * + * @param location the location value to set. + * @return the TaskRunInner object itself. + */ + public TaskRunInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of this task run. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the runRequest property: The request (parameters) for the run. + * + * @return the runRequest value. + */ + public RunRequest runRequest() { + return this.runRequest; + } + + /** + * Set the runRequest property: The request (parameters) for the run. + * + * @param runRequest the runRequest value to set. + * @return the TaskRunInner object itself. + */ + public TaskRunInner withRunRequest(RunRequest runRequest) { + this.runRequest = runRequest; + return this; + } + + /** + * Get the runResult property: The result of this task run. + * + * @return the runResult value. + */ + public RunInner runResult() { + return this.runResult; + } + + /** + * Get the forceUpdateTag property: How the run should be forced to rerun even if the run request configuration has + * not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the run should be forced to rerun even if the run request configuration has + * not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the TaskRunInner object itself. + */ + public TaskRunInner withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (runRequest() != null) { + runRequest().validate(); + } + if (runResult() != null) { + runResult().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenInner.java new file mode 100644 index 0000000000000..01a26fe8c2fef --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenInner.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** An object that represents a token for a container registry. */ +@JsonFlatten +@Fluent +public class TokenInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TokenInner.class); + + /* + * The creation date of scope map. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The resource ID of the scope map to which the token will be associated + * with. + */ + @JsonProperty(value = "properties.scopeMapId") + private String scopeMapId; + + /* + * The credentials that can be used for authenticating the token. + */ + @JsonProperty(value = "properties.credentials") + private TokenCredentialsProperties credentials; + + /* + * The status of the token example enabled or disabled. + */ + @JsonProperty(value = "properties.status") + private TokenStatus status; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @return the scopeMapId value. + */ + public String scopeMapId() { + return this.scopeMapId; + } + + /** + * Set the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @param scopeMapId the scopeMapId value to set. + * @return the TokenInner object itself. + */ + public TokenInner withScopeMapId(String scopeMapId) { + this.scopeMapId = scopeMapId; + return this; + } + + /** + * Get the credentials property: The credentials that can be used for authenticating the token. + * + * @return the credentials value. + */ + public TokenCredentialsProperties credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials that can be used for authenticating the token. + * + * @param credentials the credentials value to set. + * @return the TokenInner object itself. + */ + public TokenInner withCredentials(TokenCredentialsProperties credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the status property: The status of the token example enabled or disabled. + * + * @return the status value. + */ + public TokenStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the token example enabled or disabled. + * + * @param status the status value to set. + * @return the TokenInner object itself. + */ + public TokenInner withStatus(TokenStatus status) { + this.status = status; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookInner.java new file mode 100644 index 0000000000000..7cd1af814ecb7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** An object that represents a webhook for a container registry. */ +@JsonFlatten +@Fluent +public class WebhookInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebhookInner.class); + + /* + * The status of the webhook at the time the operation was called. + */ + @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; + + /* + * The provisioning state of the webhook at the time the operation was + * called. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the status property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the webhook at the time the operation was called. + * + * @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 property: 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 property: 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 actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: 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 provisioningState property: The provisioning state of the webhook at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public WebhookInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WebhookInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..fe41eebca6e10 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for ContainerRegistryManagementClient. null. */ +package com.azure.resourcemanager.containerregistry.generated.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/package-info.java new file mode 100644 index 0000000000000..6eed057a43481 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for ContainerRegistryManagementClient. null. */ +package com.azure.resourcemanager.containerregistry.generated.fluent; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolImpl.java new file mode 100644 index 0000000000000..6a4486edabaf0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolImpl.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPool; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPoolQueueStatus; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPoolUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class AgentPoolImpl implements AgentPool, AgentPool.Definition, AgentPool.Update { + private AgentPoolInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer count() { + return this.innerModel().count(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public OS os() { + return this.innerModel().os(); + } + + public String virtualNetworkSubnetResourceId() { + return this.innerModel().virtualNetworkSubnetResourceId(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public AgentPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String agentPoolName; + + private AgentPoolUpdateParameters updateUpdateParameters; + + public AgentPoolImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public AgentPool create() { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .create(resourceGroupName, registryName, agentPoolName, this.innerModel(), Context.NONE); + return this; + } + + public AgentPool create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .create(resourceGroupName, registryName, agentPoolName, this.innerModel(), context); + return this; + } + + AgentPoolImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new AgentPoolInner(); + this.serviceManager = serviceManager; + this.agentPoolName = name; + } + + public AgentPoolImpl update() { + this.updateUpdateParameters = new AgentPoolUpdateParameters(); + return this; + } + + public AgentPool apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .update(resourceGroupName, registryName, agentPoolName, updateUpdateParameters, Context.NONE); + return this; + } + + public AgentPool apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .update(resourceGroupName, registryName, agentPoolName, updateUpdateParameters, context); + return this; + } + + AgentPoolImpl( + AgentPoolInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.agentPoolName = Utils.getValueFromIdByName(innerObject.id(), "agentPools"); + } + + public AgentPool refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .getWithResponse(resourceGroupName, registryName, agentPoolName, Context.NONE) + .getValue(); + return this; + } + + public AgentPool refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .getWithResponse(resourceGroupName, registryName, agentPoolName, context) + .getValue(); + return this; + } + + public AgentPoolQueueStatus getQueueStatus() { + return serviceManager.agentPools().getQueueStatus(resourceGroupName, registryName, agentPoolName); + } + + public Response getQueueStatusWithResponse(Context context) { + return serviceManager + .agentPools() + .getQueueStatusWithResponse(resourceGroupName, registryName, agentPoolName, context); + } + + public AgentPoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AgentPoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AgentPoolImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateUpdateParameters.withTags(tags); + return this; + } + } + + public AgentPoolImpl withCount(Integer count) { + if (isInCreateMode()) { + this.innerModel().withCount(count); + return this; + } else { + this.updateUpdateParameters.withCount(count); + return this; + } + } + + public AgentPoolImpl withTier(String tier) { + this.innerModel().withTier(tier); + return this; + } + + public AgentPoolImpl withOs(OS os) { + this.innerModel().withOs(os); + return this; + } + + public AgentPoolImpl withVirtualNetworkSubnetResourceId(String virtualNetworkSubnetResourceId) { + this.innerModel().withVirtualNetworkSubnetResourceId(virtualNetworkSubnetResourceId); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolQueueStatusImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolQueueStatusImpl.java new file mode 100644 index 0000000000000..14ce743080f95 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolQueueStatusImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolQueueStatusInner; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPoolQueueStatus; + +public final class AgentPoolQueueStatusImpl implements AgentPoolQueueStatus { + private AgentPoolQueueStatusInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + AgentPoolQueueStatusImpl( + AgentPoolQueueStatusInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Integer count() { + return this.innerModel().count(); + } + + public AgentPoolQueueStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolsClientImpl.java new file mode 100644 index 0000000000000..f84dcfa68be09 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolsClientImpl.java @@ -0,0 +1,1637 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolQueueStatusInner; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPoolListResult; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPoolUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AgentPoolsClient. */ +public final class AgentPoolsClientImpl implements AgentPoolsClient { + private final ClientLogger logger = new ClientLogger(AgentPoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AgentPoolsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of AgentPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AgentPoolsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(AgentPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientAgentPools to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface AgentPoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/agentPools/{agentPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("agentPoolName") String agentPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/agentPools/{agentPoolName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("agentPoolName") String agentPoolName, + @BodyParam("application/json") AgentPoolInner agentPool, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/agentPools/{agentPoolName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("agentPoolName") String agentPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/agentPools/{agentPoolName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("agentPoolName") String agentPoolName, + @BodyParam("application/json") AgentPoolUpdateParameters updateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/agentPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/agentPools/{agentPoolName}/listQueueStatus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getQueueStatus( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("agentPoolName") String agentPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the detailed information for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String agentPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + agentPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the detailed information for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + agentPoolName, + accept, + context); + } + + /** + * Gets the detailed information for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String agentPoolName) { + return getWithResponseAsync(resourceGroupName, registryName, agentPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the detailed information for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner get(String resourceGroupName, String registryName, String agentPoolName) { + return getAsync(resourceGroupName, registryName, agentPoolName).block(); + } + + /** + * Gets the detailed information for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, agentPoolName, context).block(); + } + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + if (agentPool == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPool is required and cannot be null.")); + } else { + agentPool.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + agentPoolName, + agentPool, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolInner agentPool, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + if (agentPool == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPool is required and cannot be null.")); + } else { + agentPool.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + agentPoolName, + agentPool, + accept, + context); + } + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AgentPoolInner> beginCreateAsync( + String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, agentPoolName, agentPool); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AgentPoolInner.class, AgentPoolInner.class, Context.NONE); + } + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AgentPoolInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolInner agentPool, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, agentPoolName, agentPool, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AgentPoolInner.class, AgentPoolInner.class, context); + } + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AgentPoolInner> beginCreate( + String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + return beginCreateAsync(resourceGroupName, registryName, agentPoolName, agentPool).getSyncPoller(); + } + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AgentPoolInner> beginCreate( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolInner agentPool, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, agentPoolName, agentPool, context).getSyncPoller(); + } + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + return beginCreateAsync(resourceGroupName, registryName, agentPoolName, agentPool) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolInner agentPool, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, agentPoolName, agentPool, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner create( + String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + return createAsync(resourceGroupName, registryName, agentPoolName, agentPool).block(); + } + + /** + * Creates an agent pool for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner create( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolInner agentPool, + Context context) { + return createAsync(resourceGroupName, registryName, agentPoolName, agentPool, context).block(); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String agentPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + agentPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + agentPoolName, + accept, + context); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String agentPoolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, agentPoolName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, agentPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String agentPoolName) { + return beginDeleteAsync(resourceGroupName, registryName, agentPoolName).getSyncPoller(); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, agentPoolName, context).getSyncPoller(); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String agentPoolName) { + return beginDeleteAsync(resourceGroupName, registryName, agentPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, agentPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String agentPoolName) { + deleteAsync(resourceGroupName, registryName, agentPoolName).block(); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String agentPoolName, Context context) { + deleteAsync(resourceGroupName, registryName, agentPoolName, context).block(); + } + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + if (updateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateParameters is required and cannot be null.")); + } else { + updateParameters.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + agentPoolName, + updateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + if (updateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateParameters is required and cannot be null.")); + } else { + updateParameters.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + agentPoolName, + updateParameters, + accept, + context); + } + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AgentPoolInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, agentPoolName, updateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AgentPoolInner.class, AgentPoolInner.class, Context.NONE); + } + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AgentPoolInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, agentPoolName, updateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AgentPoolInner.class, AgentPoolInner.class, context); + } + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AgentPoolInner> beginUpdate( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, agentPoolName, updateParameters).getSyncPoller(); + } + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AgentPoolInner> beginUpdate( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, agentPoolName, updateParameters, context) + .getSyncPoller(); + } + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, agentPoolName, updateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, agentPoolName, updateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner update( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters) { + return updateAsync(resourceGroupName, registryName, agentPoolName, updateParameters).block(); + } + + /** + * Updates an agent pool with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner update( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, agentPoolName, updateParameters, context).block(); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the count of queued runs for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getQueueStatusWithResponseAsync( + String resourceGroupName, String registryName, String agentPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getQueueStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + agentPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the count of queued runs for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getQueueStatusWithResponseAsync( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getQueueStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + agentPoolName, + accept, + context); + } + + /** + * Gets the count of queued runs for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getQueueStatusAsync( + String resourceGroupName, String registryName, String agentPoolName) { + return getQueueStatusWithResponseAsync(resourceGroupName, registryName, agentPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the count of queued runs for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolQueueStatusInner getQueueStatus( + String resourceGroupName, String registryName, String agentPoolName) { + return getQueueStatusAsync(resourceGroupName, registryName, agentPoolName).block(); + } + + /** + * Gets the count of queued runs for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getQueueStatusWithResponse( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + return getQueueStatusWithResponseAsync(resourceGroupName, registryName, agentPoolName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolsImpl.java new file mode 100644 index 0000000000000..9701624fea5d2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolsImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolQueueStatusInner; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPool; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPoolQueueStatus; +import com.azure.resourcemanager.containerregistry.generated.models.AgentPools; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AgentPoolsImpl implements AgentPools { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolsImpl.class); + + private final AgentPoolsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public AgentPoolsImpl( + AgentPoolsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AgentPool get(String resourceGroupName, String registryName, String agentPoolName) { + AgentPoolInner inner = this.serviceClient().get(resourceGroupName, registryName, agentPoolName); + if (inner != null) { + return new AgentPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, agentPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AgentPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String agentPoolName) { + this.serviceClient().delete(resourceGroupName, registryName, agentPoolName); + } + + public void delete(String resourceGroupName, String registryName, String agentPoolName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, agentPoolName, context); + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new AgentPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new AgentPoolImpl(inner1, this.manager())); + } + + public AgentPoolQueueStatus getQueueStatus(String resourceGroupName, String registryName, String agentPoolName) { + AgentPoolQueueStatusInner inner = + this.serviceClient().getQueueStatus(resourceGroupName, registryName, agentPoolName); + if (inner != null) { + return new AgentPoolQueueStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getQueueStatusWithResponse( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + Response inner = + this.serviceClient().getQueueStatusWithResponse(resourceGroupName, registryName, agentPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AgentPoolQueueStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AgentPool getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, agentPoolName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, agentPoolName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + this.delete(resourceGroupName, registryName, agentPoolName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + this.delete(resourceGroupName, registryName, agentPoolName, context); + } + + private AgentPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public AgentPoolImpl define(String name) { + return new AgentPoolImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CallbackConfigImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CallbackConfigImpl.java new file mode 100644 index 0000000000000..f92498ee199d7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CallbackConfigImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner; +import com.azure.resourcemanager.containerregistry.generated.models.CallbackConfig; +import java.util.Collections; +import java.util.Map; + +public final class CallbackConfigImpl implements CallbackConfig { + private CallbackConfigInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + CallbackConfigImpl( + CallbackConfigInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String serviceUri() { + return this.innerModel().serviceUri(); + } + + public Map customHeaders() { + Map inner = this.innerModel().customHeaders(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CallbackConfigInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesClientImpl.java new file mode 100644 index 0000000000000..27cf208de2c7a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesClientImpl.java @@ -0,0 +1,1840 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ConnectedRegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryListResult; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConnectedRegistriesClient. */ +public final class ConnectedRegistriesClientImpl implements ConnectedRegistriesClient { + private final ClientLogger logger = new ClientLogger(ConnectedRegistriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ConnectedRegistriesService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ConnectedRegistriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectedRegistriesClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ConnectedRegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientConnectedRegistries to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface ConnectedRegistriesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries/{connectedRegistryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("connectedRegistryName") String connectedRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries/{connectedRegistryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("connectedRegistryName") String connectedRegistryName, + @BodyParam("application/json") ConnectedRegistryInner connectedRegistryCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries/{connectedRegistryName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("connectedRegistryName") String connectedRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries/{connectedRegistryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("connectedRegistryName") String connectedRegistryName, + @BodyParam("application/json") ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries/{connectedRegistryName}/deactivate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deactivate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("connectedRegistryName") String connectedRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + return getWithResponseAsync(resourceGroupName, registryName, connectedRegistryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedRegistryInner get(String resourceGroupName, String registryName, String connectedRegistryName) { + return getAsync(resourceGroupName, registryName, connectedRegistryName).block(); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, connectedRegistryName, context).block(); + } + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + if (connectedRegistryCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectedRegistryCreateParameters is required and cannot be null.")); + } else { + connectedRegistryCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + connectedRegistryCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + if (connectedRegistryCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectedRegistryCreateParameters is required and cannot be null.")); + } else { + connectedRegistryCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + connectedRegistryCreateParameters, + accept, + context); + } + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectedRegistryInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectedRegistryInner.class, + ConnectedRegistryInner.class, + Context.NONE); + } + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectedRegistryInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectedRegistryInner.class, + ConnectedRegistryInner.class, + context); + } + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectedRegistryInner> beginCreate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + return beginCreateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters) + .getSyncPoller(); + } + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectedRegistryInner> beginCreate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + return beginCreateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedRegistryInner create( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + return createAsync(resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters) + .block(); + } + + /** + * Creates a connected registry 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 connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedRegistryInner create( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + return createAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, context) + .block(); + } + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context); + } + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, connectedRegistryName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, connectedRegistryName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String connectedRegistryName) { + return beginDeleteAsync(resourceGroupName, registryName, connectedRegistryName).getSyncPoller(); + } + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, connectedRegistryName, context).getSyncPoller(); + } + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String connectedRegistryName) { + return beginDeleteAsync(resourceGroupName, registryName, connectedRegistryName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, connectedRegistryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String connectedRegistryName) { + deleteAsync(resourceGroupName, registryName, connectedRegistryName).block(); + } + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + deleteAsync(resourceGroupName, registryName, connectedRegistryName, context).block(); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + if (connectedRegistryUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectedRegistryUpdateParameters is required and cannot be null.")); + } else { + connectedRegistryUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + connectedRegistryUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + if (connectedRegistryUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectedRegistryUpdateParameters is required and cannot be null.")); + } else { + connectedRegistryUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + connectedRegistryUpdateParameters, + accept, + context); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectedRegistryInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectedRegistryInner.class, + ConnectedRegistryInner.class, + Context.NONE); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectedRegistryInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectedRegistryInner.class, + ConnectedRegistryInner.class, + context); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectedRegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + return beginUpdateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters) + .getSyncPoller(); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectedRegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + return beginUpdateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedRegistryInner update( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + return updateAsync(resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters) + .block(); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedRegistryInner update( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + return updateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, context) + .block(); + } + + /** + * Lists all connected registries 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 filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all connected registries 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 filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all connected registries 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 filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all connected registries 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all connected registries 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 filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all connected registries 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, filter)); + } + + /** + * Lists all connected registries 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 filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, filter, context)); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deactivateWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deactivate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deactivateWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deactivate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeactivateAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + Mono>> mono = + deactivateWithResponseAsync(resourceGroupName, registryName, connectedRegistryName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeactivateAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deactivateWithResponseAsync(resourceGroupName, registryName, connectedRegistryName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName) { + return beginDeactivateAsync(resourceGroupName, registryName, connectedRegistryName).getSyncPoller(); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return beginDeactivateAsync(resourceGroupName, registryName, connectedRegistryName, context).getSyncPoller(); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deactivateAsync(String resourceGroupName, String registryName, String connectedRegistryName) { + return beginDeactivateAsync(resourceGroupName, registryName, connectedRegistryName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deactivateAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return beginDeactivateAsync(resourceGroupName, registryName, connectedRegistryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deactivate(String resourceGroupName, String registryName, String connectedRegistryName) { + deactivateAsync(resourceGroupName, registryName, connectedRegistryName).block(); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deactivate( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + deactivateAsync(resourceGroupName, registryName, connectedRegistryName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesImpl.java new file mode 100644 index 0000000000000..80461b19dba12 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ConnectedRegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistries; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistry; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ConnectedRegistriesImpl implements ConnectedRegistries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedRegistriesImpl.class); + + private final ConnectedRegistriesClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ConnectedRegistriesImpl( + ConnectedRegistriesClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ConnectedRegistry get(String resourceGroupName, String registryName, String connectedRegistryName) { + ConnectedRegistryInner inner = this.serviceClient().get(resourceGroupName, registryName, connectedRegistryName); + if (inner != null) { + return new ConnectedRegistryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, connectedRegistryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConnectedRegistryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String connectedRegistryName) { + this.serviceClient().delete(resourceGroupName, registryName, connectedRegistryName); + } + + public void delete(String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, connectedRegistryName, context); + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ConnectedRegistryImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, filter, context); + return Utils.mapPage(inner, inner1 -> new ConnectedRegistryImpl(inner1, this.manager())); + } + + public void deactivate(String resourceGroupName, String registryName, String connectedRegistryName) { + this.serviceClient().deactivate(resourceGroupName, registryName, connectedRegistryName); + } + + public void deactivate( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + this.serviceClient().deactivate(resourceGroupName, registryName, connectedRegistryName, context); + } + + public ConnectedRegistry getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String connectedRegistryName = Utils.getValueFromIdByName(id, "connectedRegistries"); + if (connectedRegistryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedRegistries'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, connectedRegistryName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String connectedRegistryName = Utils.getValueFromIdByName(id, "connectedRegistries"); + if (connectedRegistryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedRegistries'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, connectedRegistryName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String connectedRegistryName = Utils.getValueFromIdByName(id, "connectedRegistries"); + if (connectedRegistryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedRegistries'.", id))); + } + this.delete(resourceGroupName, registryName, connectedRegistryName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String connectedRegistryName = Utils.getValueFromIdByName(id, "connectedRegistries"); + if (connectedRegistryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedRegistries'.", id))); + } + this.delete(resourceGroupName, registryName, connectedRegistryName, context); + } + + private ConnectedRegistriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ConnectedRegistryImpl define(String name) { + return new ConnectedRegistryImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistryImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistryImpl.java new file mode 100644 index 0000000000000..b5b2473d41930 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistryImpl.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import com.azure.resourcemanager.containerregistry.generated.models.ActivationProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistry; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryMode; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectionState; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.LoginServerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ParentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.StatusDetailProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncUpdateProperties; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ConnectedRegistryImpl + implements ConnectedRegistry, ConnectedRegistry.Definition, ConnectedRegistry.Update { + private ConnectedRegistryInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ConnectedRegistryMode mode() { + return this.innerModel().mode(); + } + + public String version() { + return this.innerModel().version(); + } + + public ConnectionState connectionState() { + return this.innerModel().connectionState(); + } + + public OffsetDateTime lastActivityTime() { + return this.innerModel().lastActivityTime(); + } + + public ActivationProperties activation() { + return this.innerModel().activation(); + } + + public ParentProperties parent() { + return this.innerModel().parent(); + } + + public List clientTokenIds() { + List inner = this.innerModel().clientTokenIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public LoginServerProperties loginServer() { + return this.innerModel().loginServer(); + } + + public LoggingProperties logging() { + return this.innerModel().logging(); + } + + public List statusDetails() { + List inner = this.innerModel().statusDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ConnectedRegistryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String connectedRegistryName; + + private ConnectedRegistryUpdateParameters updateConnectedRegistryUpdateParameters; + + public ConnectedRegistryImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public ConnectedRegistry create() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .create(resourceGroupName, registryName, connectedRegistryName, this.innerModel(), Context.NONE); + return this; + } + + public ConnectedRegistry create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .create(resourceGroupName, registryName, connectedRegistryName, this.innerModel(), context); + return this; + } + + ConnectedRegistryImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ConnectedRegistryInner(); + this.serviceManager = serviceManager; + this.connectedRegistryName = name; + } + + public ConnectedRegistryImpl update() { + this.updateConnectedRegistryUpdateParameters = new ConnectedRegistryUpdateParameters(); + return this; + } + + public ConnectedRegistry apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .update( + resourceGroupName, + registryName, + connectedRegistryName, + updateConnectedRegistryUpdateParameters, + Context.NONE); + return this; + } + + public ConnectedRegistry apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .update( + resourceGroupName, + registryName, + connectedRegistryName, + updateConnectedRegistryUpdateParameters, + context); + return this; + } + + ConnectedRegistryImpl( + ConnectedRegistryInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.connectedRegistryName = Utils.getValueFromIdByName(innerObject.id(), "connectedRegistries"); + } + + public ConnectedRegistry refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .getWithResponse(resourceGroupName, registryName, connectedRegistryName, Context.NONE) + .getValue(); + return this; + } + + public ConnectedRegistry refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .getWithResponse(resourceGroupName, registryName, connectedRegistryName, context) + .getValue(); + return this; + } + + public void deactivate() { + serviceManager.connectedRegistries().deactivate(resourceGroupName, registryName, connectedRegistryName); + } + + public void deactivate(Context context) { + serviceManager + .connectedRegistries() + .deactivate(resourceGroupName, registryName, connectedRegistryName, context); + } + + public ConnectedRegistryImpl withMode(ConnectedRegistryMode mode) { + this.innerModel().withMode(mode); + return this; + } + + public ConnectedRegistryImpl withParent(ParentProperties parent) { + this.innerModel().withParent(parent); + return this; + } + + public ConnectedRegistryImpl withClientTokenIds(List clientTokenIds) { + if (isInCreateMode()) { + this.innerModel().withClientTokenIds(clientTokenIds); + return this; + } else { + this.updateConnectedRegistryUpdateParameters.withClientTokenIds(clientTokenIds); + return this; + } + } + + public ConnectedRegistryImpl withLoginServer(LoginServerProperties loginServer) { + this.innerModel().withLoginServer(loginServer); + return this; + } + + public ConnectedRegistryImpl withLogging(LoggingProperties logging) { + if (isInCreateMode()) { + this.innerModel().withLogging(logging); + return this; + } else { + this.updateConnectedRegistryUpdateParameters.withLogging(logging); + return this; + } + } + + public ConnectedRegistryImpl withSyncProperties(SyncUpdateProperties syncProperties) { + this.updateConnectedRegistryUpdateParameters.withSyncProperties(syncProperties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientBuilder.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientBuilder.java new file mode 100644 index 0000000000000..cdeac88b66c37 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ContainerRegistryManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ContainerRegistryManagementClientImpl.class}) +public final class ContainerRegistryManagementClientBuilder { + /* + * The Microsoft Azure subscription ID. + */ + private String subscriptionId; + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ContainerRegistryManagementClientImpl with the provided parameters. + * + * @return an instance of ContainerRegistryManagementClientImpl. + */ + public ContainerRegistryManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ContainerRegistryManagementClientImpl client = + new ContainerRegistryManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientImpl.java new file mode 100644 index 0000000000000..882921037bdae --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientImpl.java @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerregistry.generated.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ConnectedRegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ContainerRegistryManagementClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ExportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ImportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.PipelineRunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.RegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ReplicationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.RunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ScopeMapsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.TaskRunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.TasksClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.TokensClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.WebhooksClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ContainerRegistryManagementClientImpl type. */ +@ServiceClient(builder = ContainerRegistryManagementClientBuilder.class) +public final class ContainerRegistryManagementClientImpl implements ContainerRegistryManagementClient { + private final ClientLogger logger = new ClientLogger(ContainerRegistryManagementClientImpl.class); + + /** The Microsoft Azure subscription ID. */ + private final String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ConnectedRegistriesClient object to access its operations. */ + private final ConnectedRegistriesClient connectedRegistries; + + /** + * Gets the ConnectedRegistriesClient object to access its operations. + * + * @return the ConnectedRegistriesClient object. + */ + public ConnectedRegistriesClient getConnectedRegistries() { + return this.connectedRegistries; + } + + /** The ExportPipelinesClient object to access its operations. */ + private final ExportPipelinesClient exportPipelines; + + /** + * Gets the ExportPipelinesClient object to access its operations. + * + * @return the ExportPipelinesClient object. + */ + public ExportPipelinesClient getExportPipelines() { + return this.exportPipelines; + } + + /** The RegistriesClient object to access its operations. */ + private final RegistriesClient registries; + + /** + * Gets the RegistriesClient object to access its operations. + * + * @return the RegistriesClient object. + */ + public RegistriesClient getRegistries() { + return this.registries; + } + + /** The ImportPipelinesClient object to access its operations. */ + private final ImportPipelinesClient importPipelines; + + /** + * Gets the ImportPipelinesClient object to access its operations. + * + * @return the ImportPipelinesClient object. + */ + public ImportPipelinesClient getImportPipelines() { + return this.importPipelines; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The PipelineRunsClient object to access its operations. */ + private final PipelineRunsClient pipelineRuns; + + /** + * Gets the PipelineRunsClient object to access its operations. + * + * @return the PipelineRunsClient object. + */ + public PipelineRunsClient getPipelineRuns() { + return this.pipelineRuns; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The ReplicationsClient object to access its operations. */ + private final ReplicationsClient replications; + + /** + * Gets the ReplicationsClient object to access its operations. + * + * @return the ReplicationsClient object. + */ + public ReplicationsClient getReplications() { + return this.replications; + } + + /** The ScopeMapsClient object to access its operations. */ + private final ScopeMapsClient scopeMaps; + + /** + * Gets the ScopeMapsClient object to access its operations. + * + * @return the ScopeMapsClient object. + */ + public ScopeMapsClient getScopeMaps() { + return this.scopeMaps; + } + + /** The TokensClient object to access its operations. */ + private final TokensClient tokens; + + /** + * Gets the TokensClient object to access its operations. + * + * @return the TokensClient object. + */ + public TokensClient getTokens() { + return this.tokens; + } + + /** The WebhooksClient object to access its operations. */ + private final WebhooksClient webhooks; + + /** + * Gets the WebhooksClient object to access its operations. + * + * @return the WebhooksClient object. + */ + public WebhooksClient getWebhooks() { + return this.webhooks; + } + + /** The AgentPoolsClient object to access its operations. */ + private final AgentPoolsClient agentPools; + + /** + * Gets the AgentPoolsClient object to access its operations. + * + * @return the AgentPoolsClient object. + */ + public AgentPoolsClient getAgentPools() { + return this.agentPools; + } + + /** The RunsClient object to access its operations. */ + private final RunsClient runs; + + /** + * Gets the RunsClient object to access its operations. + * + * @return the RunsClient object. + */ + public RunsClient getRuns() { + return this.runs; + } + + /** The TaskRunsClient object to access its operations. */ + private final TaskRunsClient taskRuns; + + /** + * Gets the TaskRunsClient object to access its operations. + * + * @return the TaskRunsClient object. + */ + public TaskRunsClient getTaskRuns() { + return this.taskRuns; + } + + /** The TasksClient object to access its operations. */ + private final TasksClient tasks; + + /** + * Gets the TasksClient object to access its operations. + * + * @return the TasksClient object. + */ + public TasksClient getTasks() { + return this.tasks; + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The Microsoft Azure subscription ID. + * @param endpoint server parameter. + */ + ContainerRegistryManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.connectedRegistries = new ConnectedRegistriesClientImpl(this); + this.exportPipelines = new ExportPipelinesClientImpl(this); + this.registries = new RegistriesClientImpl(this); + this.importPipelines = new ImportPipelinesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.pipelineRuns = new PipelineRunsClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.replications = new ReplicationsClientImpl(this); + this.scopeMaps = new ScopeMapsClientImpl(this); + this.tokens = new TokensClientImpl(this); + this.webhooks = new WebhooksClientImpl(this); + this.agentPools = new AgentPoolsClientImpl(this); + this.runs = new RunsClientImpl(this); + this.taskRuns = new TaskRunsClientImpl(this); + this.tasks = new TasksClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventImpl.java new file mode 100644 index 0000000000000..d13c7af2187bd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; +import com.azure.resourcemanager.containerregistry.generated.models.Event; +import com.azure.resourcemanager.containerregistry.generated.models.EventRequestMessage; +import com.azure.resourcemanager.containerregistry.generated.models.EventResponseMessage; + +public final class EventImpl implements Event { + private EventInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + EventImpl( + EventInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public EventRequestMessage eventRequestMessage() { + return this.innerModel().eventRequestMessage(); + } + + public EventResponseMessage eventResponseMessage() { + return this.innerModel().eventResponseMessage(); + } + + public EventInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventInfoImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventInfoImpl.java new file mode 100644 index 0000000000000..1115ba10c034c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventInfoImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner; +import com.azure.resourcemanager.containerregistry.generated.models.EventInfo; + +public final class EventInfoImpl implements EventInfo { + private EventInfoInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + EventInfoImpl( + EventInfoInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public EventInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelineImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelineImpl.java new file mode 100644 index 0000000000000..a75aa3df415b0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelineImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipeline; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelineTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ExportPipelineImpl implements ExportPipeline, ExportPipeline.Definition { + private ExportPipelineInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + ExportPipelineImpl( + ExportPipelineInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public IdentityProperties identity() { + return this.innerModel().identity(); + } + + public ExportPipelineTargetProperties target() { + return this.innerModel().target(); + } + + public List options() { + List inner = this.innerModel().options(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ExportPipelineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String exportPipelineName; + + public ExportPipelineImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public ExportPipeline create() { + this.innerObject = + serviceManager + .serviceClient() + .getExportPipelines() + .create(resourceGroupName, registryName, exportPipelineName, this.innerModel(), Context.NONE); + return this; + } + + public ExportPipeline create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExportPipelines() + .create(resourceGroupName, registryName, exportPipelineName, this.innerModel(), context); + return this; + } + + ExportPipelineImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ExportPipelineInner(); + this.serviceManager = serviceManager; + this.exportPipelineName = name; + } + + public ExportPipeline refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExportPipelines() + .getWithResponse(resourceGroupName, registryName, exportPipelineName, Context.NONE) + .getValue(); + return this; + } + + public ExportPipeline refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExportPipelines() + .getWithResponse(resourceGroupName, registryName, exportPipelineName, context) + .getValue(); + return this; + } + + public ExportPipelineImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExportPipelineImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExportPipelineImpl withIdentity(IdentityProperties identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ExportPipelineImpl withTarget(ExportPipelineTargetProperties target) { + this.innerModel().withTarget(target); + return this; + } + + public ExportPipelineImpl withOptions(List options) { + this.innerModel().withOptions(options); + return this; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesClientImpl.java new file mode 100644 index 0000000000000..0101e16d0b89d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesClientImpl.java @@ -0,0 +1,1149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ExportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelineListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExportPipelinesClient. */ +public final class ExportPipelinesClientImpl implements ExportPipelinesClient { + private final ClientLogger logger = new ClientLogger(ExportPipelinesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExportPipelinesService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ExportPipelinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExportPipelinesClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ExportPipelinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientExportPipelines to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface ExportPipelinesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/exportPipelines/{exportPipelineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("exportPipelineName") String exportPipelineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/exportPipelines/{exportPipelineName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("exportPipelineName") String exportPipelineName, + @BodyParam("application/json") ExportPipelineInner exportPipelineCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/exportPipelines/{exportPipelineName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("exportPipelineName") String exportPipelineName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/exportPipelines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String exportPipelineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + accept, + context); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String exportPipelineName) { + return getWithResponseAsync(resourceGroupName, registryName, exportPipelineName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportPipelineInner get(String resourceGroupName, String registryName, String exportPipelineName) { + return getAsync(resourceGroupName, registryName, exportPipelineName).block(); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, exportPipelineName, context).block(); + } + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + if (exportPipelineCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter exportPipelineCreateParameters is required and cannot be null.")); + } else { + exportPipelineCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + exportPipelineCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + if (exportPipelineCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter exportPipelineCreateParameters is required and cannot be null.")); + } else { + exportPipelineCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + exportPipelineCreateParameters, + accept, + context); + } + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExportPipelineInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExportPipelineInner.class, + ExportPipelineInner.class, + Context.NONE); + } + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExportPipelineInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExportPipelineInner.class, ExportPipelineInner.class, context); + } + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters) + .getSyncPoller(); + } + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportPipelineInner create( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + return createAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters).block(); + } + + /** + * Creates an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportPipelineInner create( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, context) + .block(); + } + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String exportPipelineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + context); + } + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String exportPipelineName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, exportPipelineName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, exportPipelineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String exportPipelineName) { + return beginDeleteAsync(resourceGroupName, registryName, exportPipelineName).getSyncPoller(); + } + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, exportPipelineName, context).getSyncPoller(); + } + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String exportPipelineName) { + return beginDeleteAsync(resourceGroupName, registryName, exportPipelineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, exportPipelineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String exportPipelineName) { + deleteAsync(resourceGroupName, registryName, exportPipelineName).block(); + } + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String exportPipelineName, Context context) { + deleteAsync(resourceGroupName, registryName, exportPipelineName, context).block(); + } + + /** + * Lists all export pipelines 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all export pipelines 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all export pipelines 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all export pipelines 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all export pipelines 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all export pipelines 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesImpl.java new file mode 100644 index 0000000000000..01dc3e83e126b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesImpl.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ExportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipeline; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelines; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExportPipelinesImpl implements ExportPipelines { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportPipelinesImpl.class); + + private final ExportPipelinesClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ExportPipelinesImpl( + ExportPipelinesClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExportPipeline get(String resourceGroupName, String registryName, String exportPipelineName) { + ExportPipelineInner inner = this.serviceClient().get(resourceGroupName, registryName, exportPipelineName); + if (inner != null) { + return new ExportPipelineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, exportPipelineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExportPipelineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String exportPipelineName) { + this.serviceClient().delete(resourceGroupName, registryName, exportPipelineName); + } + + public void delete(String resourceGroupName, String registryName, String exportPipelineName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, exportPipelineName, context); + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ExportPipelineImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new ExportPipelineImpl(inner1, this.manager())); + } + + public ExportPipeline getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String exportPipelineName = Utils.getValueFromIdByName(id, "exportPipelines"); + if (exportPipelineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'exportPipelines'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, exportPipelineName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String exportPipelineName = Utils.getValueFromIdByName(id, "exportPipelines"); + if (exportPipelineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'exportPipelines'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, exportPipelineName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String exportPipelineName = Utils.getValueFromIdByName(id, "exportPipelines"); + if (exportPipelineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'exportPipelines'.", id))); + } + this.delete(resourceGroupName, registryName, exportPipelineName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String exportPipelineName = Utils.getValueFromIdByName(id, "exportPipelines"); + if (exportPipelineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'exportPipelines'.", id))); + } + this.delete(resourceGroupName, registryName, exportPipelineName, context); + } + + private ExportPipelinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ExportPipelineImpl define(String name) { + return new ExportPipelineImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/GenerateCredentialsResultImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/GenerateCredentialsResultImpl.java new file mode 100644 index 0000000000000..266be14982cbe --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/GenerateCredentialsResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.TokenPassword; +import java.util.Collections; +import java.util.List; + +public final class GenerateCredentialsResultImpl implements GenerateCredentialsResult { + private GenerateCredentialsResultInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + GenerateCredentialsResultImpl( + GenerateCredentialsResultInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String username() { + return this.innerModel().username(); + } + + public List passwords() { + List inner = this.innerModel().passwords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public GenerateCredentialsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelineImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelineImpl.java new file mode 100644 index 0000000000000..b1ea594152f72 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelineImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipeline; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelineSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineTriggerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ImportPipelineImpl implements ImportPipeline, ImportPipeline.Definition { + private ImportPipelineInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + ImportPipelineImpl( + ImportPipelineInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public IdentityProperties identity() { + return this.innerModel().identity(); + } + + public ImportPipelineSourceProperties source() { + return this.innerModel().source(); + } + + public PipelineTriggerProperties trigger() { + return this.innerModel().trigger(); + } + + public List options() { + List inner = this.innerModel().options(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ImportPipelineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String importPipelineName; + + public ImportPipelineImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public ImportPipeline create() { + this.innerObject = + serviceManager + .serviceClient() + .getImportPipelines() + .create(resourceGroupName, registryName, importPipelineName, this.innerModel(), Context.NONE); + return this; + } + + public ImportPipeline create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getImportPipelines() + .create(resourceGroupName, registryName, importPipelineName, this.innerModel(), context); + return this; + } + + ImportPipelineImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ImportPipelineInner(); + this.serviceManager = serviceManager; + this.importPipelineName = name; + } + + public ImportPipeline refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getImportPipelines() + .getWithResponse(resourceGroupName, registryName, importPipelineName, Context.NONE) + .getValue(); + return this; + } + + public ImportPipeline refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getImportPipelines() + .getWithResponse(resourceGroupName, registryName, importPipelineName, context) + .getValue(); + return this; + } + + public ImportPipelineImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ImportPipelineImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ImportPipelineImpl withIdentity(IdentityProperties identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ImportPipelineImpl withSource(ImportPipelineSourceProperties source) { + this.innerModel().withSource(source); + return this; + } + + public ImportPipelineImpl withTrigger(PipelineTriggerProperties trigger) { + this.innerModel().withTrigger(trigger); + return this; + } + + public ImportPipelineImpl withOptions(List options) { + this.innerModel().withOptions(options); + return this; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesClientImpl.java new file mode 100644 index 0000000000000..c10ee9197903d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesClientImpl.java @@ -0,0 +1,1149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ImportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelineListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ImportPipelinesClient. */ +public final class ImportPipelinesClientImpl implements ImportPipelinesClient { + private final ClientLogger logger = new ClientLogger(ImportPipelinesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ImportPipelinesService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ImportPipelinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ImportPipelinesClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ImportPipelinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientImportPipelines to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface ImportPipelinesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/importPipelines/{importPipelineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("importPipelineName") String importPipelineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/importPipelines/{importPipelineName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("importPipelineName") String importPipelineName, + @BodyParam("application/json") ImportPipelineInner importPipelineCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/importPipelines/{importPipelineName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("importPipelineName") String importPipelineName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/importPipelines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String importPipelineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + accept, + context); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String importPipelineName) { + return getWithResponseAsync(resourceGroupName, registryName, importPipelineName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImportPipelineInner get(String resourceGroupName, String registryName, String importPipelineName) { + return getAsync(resourceGroupName, registryName, importPipelineName).block(); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, importPipelineName, context).block(); + } + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + if (importPipelineCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter importPipelineCreateParameters is required and cannot be null.")); + } else { + importPipelineCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + importPipelineCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + if (importPipelineCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter importPipelineCreateParameters is required and cannot be null.")); + } else { + importPipelineCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + importPipelineCreateParameters, + accept, + context); + } + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ImportPipelineInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ImportPipelineInner.class, + ImportPipelineInner.class, + Context.NONE); + } + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ImportPipelineInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ImportPipelineInner.class, ImportPipelineInner.class, context); + } + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ImportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters) + .getSyncPoller(); + } + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ImportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImportPipelineInner create( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + return createAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters).block(); + } + + /** + * Creates an import pipeline 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 importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImportPipelineInner create( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, context) + .block(); + } + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String importPipelineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + context); + } + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String importPipelineName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, importPipelineName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, importPipelineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String importPipelineName) { + return beginDeleteAsync(resourceGroupName, registryName, importPipelineName).getSyncPoller(); + } + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, importPipelineName, context).getSyncPoller(); + } + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String importPipelineName) { + return beginDeleteAsync(resourceGroupName, registryName, importPipelineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, importPipelineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String importPipelineName) { + deleteAsync(resourceGroupName, registryName, importPipelineName).block(); + } + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String importPipelineName, Context context) { + deleteAsync(resourceGroupName, registryName, importPipelineName, context).block(); + } + + /** + * Lists all import pipelines 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all import pipelines 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all import pipelines 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all import pipelines 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all import pipelines 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all import pipelines 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesImpl.java new file mode 100644 index 0000000000000..b8276c348c9fd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesImpl.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ImportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipeline; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelines; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ImportPipelinesImpl implements ImportPipelines { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImportPipelinesImpl.class); + + private final ImportPipelinesClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ImportPipelinesImpl( + ImportPipelinesClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ImportPipeline get(String resourceGroupName, String registryName, String importPipelineName) { + ImportPipelineInner inner = this.serviceClient().get(resourceGroupName, registryName, importPipelineName); + if (inner != null) { + return new ImportPipelineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, importPipelineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ImportPipelineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String importPipelineName) { + this.serviceClient().delete(resourceGroupName, registryName, importPipelineName); + } + + public void delete(String resourceGroupName, String registryName, String importPipelineName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, importPipelineName, context); + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ImportPipelineImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new ImportPipelineImpl(inner1, this.manager())); + } + + public ImportPipeline getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String importPipelineName = Utils.getValueFromIdByName(id, "importPipelines"); + if (importPipelineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'importPipelines'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, importPipelineName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String importPipelineName = Utils.getValueFromIdByName(id, "importPipelines"); + if (importPipelineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'importPipelines'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, importPipelineName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String importPipelineName = Utils.getValueFromIdByName(id, "importPipelines"); + if (importPipelineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'importPipelines'.", id))); + } + this.delete(resourceGroupName, registryName, importPipelineName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String importPipelineName = Utils.getValueFromIdByName(id, "importPipelines"); + if (importPipelineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'importPipelines'.", id))); + } + this.delete(resourceGroupName, registryName, importPipelineName, context); + } + + private ImportPipelinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ImportPipelineImpl define(String name) { + return new ImportPipelineImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationDefinitionImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationDefinitionImpl.java new file mode 100644 index 0000000000000..5deb72956300f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationDefinitionImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; +import com.azure.resourcemanager.containerregistry.generated.models.OperationDefinition; +import com.azure.resourcemanager.containerregistry.generated.models.OperationDisplayDefinition; +import com.azure.resourcemanager.containerregistry.generated.models.OperationServiceSpecificationDefinition; + +public final class OperationDefinitionImpl implements OperationDefinition { + private OperationDefinitionInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + OperationDefinitionImpl( + OperationDefinitionInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String origin() { + return this.innerModel().origin(); + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplayDefinition display() { + return this.innerModel().display(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationServiceSpecificationDefinition serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..aa20d3fb605c2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; +import com.azure.resourcemanager.containerregistry.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ContainerRegistry/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..433144bed7c6b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; +import com.azure.resourcemanager.containerregistry.generated.models.OperationDefinition; +import com.azure.resourcemanager.containerregistry.generated.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationDefinitionImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunImpl.java new file mode 100644 index 0000000000000..c7927a47e14a3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunImpl.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRun; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunResponse; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; + +public final class PipelineRunImpl implements PipelineRun, PipelineRun.Definition { + private PipelineRunInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + PipelineRunImpl( + PipelineRunInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PipelineRunRequest request() { + return this.innerModel().request(); + } + + public PipelineRunResponse response() { + return this.innerModel().response(); + } + + public String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PipelineRunInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String pipelineRunName; + + public PipelineRunImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public PipelineRun create() { + this.innerObject = + serviceManager + .serviceClient() + .getPipelineRuns() + .create(resourceGroupName, registryName, pipelineRunName, this.innerModel(), Context.NONE); + return this; + } + + public PipelineRun create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPipelineRuns() + .create(resourceGroupName, registryName, pipelineRunName, this.innerModel(), context); + return this; + } + + PipelineRunImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new PipelineRunInner(); + this.serviceManager = serviceManager; + this.pipelineRunName = name; + } + + public PipelineRun refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPipelineRuns() + .getWithResponse(resourceGroupName, registryName, pipelineRunName, Context.NONE) + .getValue(); + return this; + } + + public PipelineRun refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPipelineRuns() + .getWithResponse(resourceGroupName, registryName, pipelineRunName, context) + .getValue(); + return this; + } + + public PipelineRunImpl withRequest(PipelineRunRequest request) { + this.innerModel().withRequest(request); + return this; + } + + public PipelineRunImpl withForceUpdateTag(String forceUpdateTag) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsClientImpl.java new file mode 100644 index 0000000000000..796a6fc56d660 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsClientImpl.java @@ -0,0 +1,1140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.PipelineRunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PipelineRunsClient. */ +public final class PipelineRunsClientImpl implements PipelineRunsClient { + private final ClientLogger logger = new ClientLogger(PipelineRunsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PipelineRunsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of PipelineRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PipelineRunsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(PipelineRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientPipelineRuns to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface PipelineRunsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/pipelineRuns/{pipelineRunName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("pipelineRunName") String pipelineRunName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/pipelineRuns/{pipelineRunName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("pipelineRunName") String pipelineRunName, + @BodyParam("application/json") PipelineRunInner pipelineRunCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/pipelineRuns/{pipelineRunName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("pipelineRunName") String pipelineRunName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/pipelineRuns") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String pipelineRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + accept, + context); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String pipelineRunName) { + return getWithResponseAsync(resourceGroupName, registryName, pipelineRunName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineRunInner get(String resourceGroupName, String registryName, String pipelineRunName) { + return getAsync(resourceGroupName, registryName, pipelineRunName).block(); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, pipelineRunName, context).block(); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + if (pipelineRunCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter pipelineRunCreateParameters is required and cannot be null.")); + } else { + pipelineRunCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + pipelineRunCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + if (pipelineRunCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter pipelineRunCreateParameters is required and cannot be null.")); + } else { + pipelineRunCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + pipelineRunCreateParameters, + accept, + context); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PipelineRunInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PipelineRunInner.class, PipelineRunInner.class, Context.NONE); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PipelineRunInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PipelineRunInner.class, PipelineRunInner.class, context); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PipelineRunInner> beginCreate( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters) + .getSyncPoller(); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PipelineRunInner> beginCreate( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineRunInner create( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + return createAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters).block(); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineRunInner create( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters, context) + .block(); + } + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String pipelineRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + context); + } + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String pipelineRunName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, pipelineRunName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, pipelineRunName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String pipelineRunName) { + return beginDeleteAsync(resourceGroupName, registryName, pipelineRunName).getSyncPoller(); + } + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, pipelineRunName, context).getSyncPoller(); + } + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String pipelineRunName) { + return beginDeleteAsync(resourceGroupName, registryName, pipelineRunName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, pipelineRunName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String pipelineRunName) { + deleteAsync(resourceGroupName, registryName, pipelineRunName).block(); + } + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String pipelineRunName, Context context) { + deleteAsync(resourceGroupName, registryName, pipelineRunName, context).block(); + } + + /** + * Lists all the pipeline runs 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the pipeline runs 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the pipeline runs 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the pipeline runs 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the pipeline runs 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the pipeline runs 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsImpl.java new file mode 100644 index 0000000000000..8c8fce92223e4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.PipelineRunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRun; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRuns; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PipelineRunsImpl implements PipelineRuns { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineRunsImpl.class); + + private final PipelineRunsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public PipelineRunsImpl( + PipelineRunsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PipelineRun get(String resourceGroupName, String registryName, String pipelineRunName) { + PipelineRunInner inner = this.serviceClient().get(resourceGroupName, registryName, pipelineRunName); + if (inner != null) { + return new PipelineRunImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, pipelineRunName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PipelineRunImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String pipelineRunName) { + this.serviceClient().delete(resourceGroupName, registryName, pipelineRunName); + } + + public void delete(String resourceGroupName, String registryName, String pipelineRunName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, pipelineRunName, context); + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new PipelineRunImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new PipelineRunImpl(inner1, this.manager())); + } + + public PipelineRun getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String pipelineRunName = Utils.getValueFromIdByName(id, "pipelineRuns"); + if (pipelineRunName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelineRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, pipelineRunName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String pipelineRunName = Utils.getValueFromIdByName(id, "pipelineRuns"); + if (pipelineRunName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelineRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, pipelineRunName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String pipelineRunName = Utils.getValueFromIdByName(id, "pipelineRuns"); + if (pipelineRunName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelineRuns'.", id))); + } + this.delete(resourceGroupName, registryName, pipelineRunName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String pipelineRunName = Utils.getValueFromIdByName(id, "pipelineRuns"); + if (pipelineRunName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelineRuns'.", id))); + } + this.delete(resourceGroupName, registryName, pipelineRunName, context); + } + + private PipelineRunsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public PipelineRunImpl define(String name) { + return new PipelineRunImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..a1d629eaa775d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, registryName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, registryName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, registryName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, registryName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..91f704a149d51 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientPrivateEndpointConnections to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnection, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, registryName, privateEndpointConnectionName).block(); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, context).block(); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + privateEndpointConnection, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + privateEndpointConnection, + accept, + context); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + Context.NONE); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, context) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return createOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection) + .block(); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return createOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, context) + .block(); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + context); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, registryName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, registryName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, registryName, privateEndpointConnectionName).block(); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, registryName, privateEndpointConnectionName, context).block(); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..a102da34756f0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnection get( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, registryName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, registryName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, privateEndpointConnectionName, context); + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, registryName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, registryName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateLinkResourceImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..b7d6bfa749962 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String type() { + return this.innerModel().type(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesClientImpl.java new file mode 100644 index 0000000000000..57635e67359ed --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesClientImpl.java @@ -0,0 +1,3574 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.RegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.SourceUploadDefinitionInner; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryListResult; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameCheckRequest; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.RunRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistriesClient. */ +public final class RegistriesClientImpl implements RegistriesClient { + private final ClientLogger logger = new ClientLogger(RegistriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RegistriesService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RegistriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistriesClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(RegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientRegistries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface RegistriesService { + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/importImage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> importImage( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @BodyParam("application/json") ImportImageParameters parameters, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RegistryNameCheckRequest registryNameCheckRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @BodyParam("application/json") RegistryInner registry, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @BodyParam("application/json") RegistryUpdateParameters registryUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/listCredentials") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCredentials( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/regenerateCredential") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateCredential( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @BodyParam("application/json") RegenerateCredentialParameters regenerateCredentialParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/listUsages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsages( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPrivateLinkResources( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/generateCredentials") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateCredentials( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @BodyParam("application/json") GenerateCredentialsParameters generateCredentialsParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scheduleRun") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> scheduleRun( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RunRequest runRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/listBuildSourceUploadUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBuildSourceUploadUrl( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPrivateLinkResourcesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> importImageWithResponseAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + return FluxUtil + .withContext( + context -> + service + .importImage( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> importImageWithResponseAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + context = this.client.mergeContext(context); + return service + .importImage( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + parameters, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginImportImageAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters) { + Mono>> mono = + importImageWithResponseAsync(resourceGroupName, registryName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginImportImageAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + importImageWithResponseAsync(resourceGroupName, registryName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginImportImage( + String resourceGroupName, String registryName, ImportImageParameters parameters) { + return beginImportImageAsync(resourceGroupName, registryName, parameters).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginImportImage( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + return beginImportImageAsync(resourceGroupName, registryName, parameters, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono importImageAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters) { + return beginImportImageAsync(resourceGroupName, registryName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono importImageAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + return beginImportImageAsync(resourceGroupName, registryName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + importImageAsync(resourceGroupName, registryName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void importImage( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + importImageAsync(resourceGroupName, registryName, parameters, context).block(); + } + + /** + * 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 registryNameCheckRequest The object containing information for the availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + RegistryNameCheckRequest registryNameCheckRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (registryNameCheckRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter registryNameCheckRequest is required and cannot be null.")); + } else { + registryNameCheckRequest.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + registryNameCheckRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 registryNameCheckRequest The object containing information for the availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + RegistryNameCheckRequest registryNameCheckRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (registryNameCheckRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter registryNameCheckRequest is required and cannot be null.")); + } else { + registryNameCheckRequest.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + registryNameCheckRequest, + accept, + context); + } + + /** + * 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 registryNameCheckRequest The object containing information for the availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + RegistryNameCheckRequest registryNameCheckRequest) { + return checkNameAvailabilityWithResponseAsync(registryNameCheckRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 registryNameCheckRequest The object containing information for the availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryNameStatusInner checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest) { + return checkNameAvailabilityAsync(registryNameCheckRequest).block(); + } + + /** + * 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 registryNameCheckRequest The object containing information for the availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, Context context) { + return checkNameAvailabilityWithResponseAsync(registryNameCheckRequest, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, registryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupAsync(resourceGroupName, registryName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (registry == null) { + return Mono.error(new IllegalArgumentException("Parameter registry is required and cannot be null.")); + } else { + registry.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + registry, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (registry == null) { + return Mono.error(new IllegalArgumentException("Parameter registry is required and cannot be null.")); + } else { + registry.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + registry, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RegistryInner> beginCreateAsync( + String resourceGroupName, String registryName, RegistryInner registry) { + Mono>> mono = createWithResponseAsync(resourceGroupName, registryName, registry); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RegistryInner.class, RegistryInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RegistryInner> beginCreateAsync( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, registry, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RegistryInner.class, RegistryInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RegistryInner> beginCreate( + String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateAsync(resourceGroupName, registryName, registry).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RegistryInner> beginCreate( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + return beginCreateAsync(resourceGroupName, registryName, registry, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateAsync(resourceGroupName, registryName, registry) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + return beginCreateAsync(resourceGroupName, registryName, registry, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry) { + return createAsync(resourceGroupName, registryName, registry).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner create( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + return createAsync(resourceGroupName, registryName, registry, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName) { + return beginDeleteAsync(resourceGroupName, registryName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName) { + return beginDeleteAsync(resourceGroupName, registryName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName) { + deleteAsync(resourceGroupName, registryName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, Context context) { + deleteAsync(resourceGroupName, registryName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (registryUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null.")); + } else { + registryUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + registryUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (registryUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null.")); + } else { + registryUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + registryUpdateParameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RegistryInner> beginUpdateAsync( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, registryUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RegistryInner.class, RegistryInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RegistryInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, registryUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RegistryInner.class, RegistryInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RegistryInner> beginUpdate( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner update( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateAsync(resourceGroupName, registryName, registryUpdateParameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner update( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, registryUpdateParameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCredentialsWithResponseAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCredentialsWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listCredentialsAsync( + String resourceGroupName, String registryName) { + return listCredentialsWithResponseAsync(resourceGroupName, registryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName) { + return listCredentialsAsync(resourceGroupName, registryName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context) { + return listCredentialsWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * 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 regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateCredentialWithResponseAsync( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (regenerateCredentialParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter regenerateCredentialParameters is required and cannot be null.")); + } else { + regenerateCredentialParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateCredential( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + regenerateCredentialParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateCredentialWithResponseAsync( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (regenerateCredentialParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter regenerateCredentialParameters is required and cannot be null.")); + } else { + regenerateCredentialParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateCredential( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + regenerateCredentialParameters, + accept, + context); + } + + /** + * 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 regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateCredentialAsync( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { + return regenerateCredentialWithResponseAsync(resourceGroupName, registryName, regenerateCredentialParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryListCredentialsResultInner regenerateCredential( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { + return regenerateCredentialAsync(resourceGroupName, registryName, regenerateCredentialParameters).block(); + } + + /** + * 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 regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context) { + return regenerateCredentialWithResponseAsync( + resourceGroupName, registryName, regenerateCredentialParameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesWithResponseAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listUsages( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listUsages( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listUsagesAsync(String resourceGroupName, String registryName) { + return listUsagesWithResponseAsync(resourceGroupName, registryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName) { + return listUsagesAsync(resourceGroupName, registryName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context) { + return listUsagesWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateLinkResourcesSinglePageAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPrivateLinkResources( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateLinkResourcesSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPrivateLinkResources( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrivateLinkResourcesAsync( + String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listPrivateLinkResourcesSinglePageAsync(resourceGroupName, registryName), + nextLink -> listPrivateLinkResourcesNextSinglePageAsync(nextLink)); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrivateLinkResourcesAsync( + String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listPrivateLinkResourcesSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listPrivateLinkResourcesNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName) { + return new PagedIterable<>(listPrivateLinkResourcesAsync(resourceGroupName, registryName)); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listPrivateLinkResourcesAsync(resourceGroupName, registryName, context)); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateCredentialsWithResponseAsync( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (generateCredentialsParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter generateCredentialsParameters is required and cannot be null.")); + } else { + generateCredentialsParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + generateCredentialsParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateCredentialsWithResponseAsync( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (generateCredentialsParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter generateCredentialsParameters is required and cannot be null.")); + } else { + generateCredentialsParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + generateCredentialsParameters, + accept, + context); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GenerateCredentialsResultInner> + beginGenerateCredentialsAsync( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters) { + Mono>> mono = + generateCredentialsWithResponseAsync(resourceGroupName, registryName, generateCredentialsParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GenerateCredentialsResultInner.class, + GenerateCredentialsResultInner.class, + Context.NONE); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GenerateCredentialsResultInner> + beginGenerateCredentialsAsync( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + generateCredentialsWithResponseAsync( + resourceGroupName, registryName, generateCredentialsParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GenerateCredentialsResultInner.class, + GenerateCredentialsResultInner.class, + context); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GenerateCredentialsResultInner> + beginGenerateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters) { + return beginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters) + .getSyncPoller(); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GenerateCredentialsResultInner> + beginGenerateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + return beginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters, context) + .getSyncPoller(); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateCredentialsAsync( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + return beginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateCredentialsAsync( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + return beginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenerateCredentialsResultInner generateCredentials( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + return generateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters).block(); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenerateCredentialsResultInner generateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + return generateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters, context) + .block(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> scheduleRunWithResponseAsync( + String resourceGroupName, String registryName, RunRequest runRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); + } else { + runRequest.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .scheduleRun( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + runRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> scheduleRunWithResponseAsync( + String resourceGroupName, String registryName, RunRequest runRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); + } else { + runRequest.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .scheduleRun( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + runRequest, + accept, + context); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RunInner> beginScheduleRunAsync( + String resourceGroupName, String registryName, RunRequest runRequest) { + Mono>> mono = + scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RunInner.class, RunInner.class, Context.NONE); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RunInner> beginScheduleRunAsync( + String resourceGroupName, String registryName, RunRequest runRequest, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RunInner.class, RunInner.class, context); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RunInner> beginScheduleRun( + String resourceGroupName, String registryName, RunRequest runRequest) { + return beginScheduleRunAsync(resourceGroupName, registryName, runRequest).getSyncPoller(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RunInner> beginScheduleRun( + String resourceGroupName, String registryName, RunRequest runRequest, Context context) { + return beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).getSyncPoller(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + return beginScheduleRunAsync(resourceGroupName, registryName, runRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono scheduleRunAsync( + String resourceGroupName, String registryName, RunRequest runRequest, Context context) { + return beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { + return scheduleRunAsync(resourceGroupName, registryName, runRequest).block(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context) { + return scheduleRunAsync(resourceGroupName, registryName, runRequest, context).block(); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildSourceUploadUrlWithResponseAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getBuildSourceUploadUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildSourceUploadUrlWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBuildSourceUploadUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + accept, + context); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBuildSourceUploadUrlAsync( + String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlAsync(resourceGroupName, registryName).block(); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuildSourceUploadUrlWithResponse( + String resourceGroupName, String registryName, Context context) { + return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateLinkResourcesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listPrivateLinkResourcesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateLinkResourcesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPrivateLinkResourcesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesImpl.java new file mode 100644 index 0000000000000..7a846401304bd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesImpl.java @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.RegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.SourceUploadDefinitionInner; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Registries; +import com.azure.resourcemanager.containerregistry.generated.models.Registry; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryListCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameCheckRequest; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameStatus; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUsageListResult; +import com.azure.resourcemanager.containerregistry.generated.models.Run; +import com.azure.resourcemanager.containerregistry.generated.models.RunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.SourceUploadDefinition; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RegistriesImpl implements Registries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistriesImpl.class); + + private final RegistriesClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public RegistriesImpl( + RegistriesClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + this.serviceClient().importImage(resourceGroupName, registryName, parameters); + } + + public void importImage( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + this.serviceClient().importImage(resourceGroupName, registryName, parameters, context); + } + + public RegistryNameStatus checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest) { + RegistryNameStatusInner inner = this.serviceClient().checkNameAvailability(registryNameCheckRequest); + if (inner != null) { + return new RegistryNameStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(registryNameCheckRequest, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryNameStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Registry getByResourceGroup(String resourceGroupName, String registryName) { + RegistryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, registryName); + if (inner != null) { + return new RegistryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, registryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String registryName) { + this.serviceClient().delete(resourceGroupName, registryName); + } + + public void delete(String resourceGroupName, String registryName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public RegistryListCredentialsResult listCredentials(String resourceGroupName, String registryName) { + RegistryListCredentialsResultInner inner = + this.serviceClient().listCredentials(resourceGroupName, registryName); + if (inner != null) { + return new RegistryListCredentialsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context) { + Response inner = + this.serviceClient().listCredentialsWithResponse(resourceGroupName, registryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryListCredentialsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RegistryListCredentialsResult regenerateCredential( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { + RegistryListCredentialsResultInner inner = + this.serviceClient().regenerateCredential(resourceGroupName, registryName, regenerateCredentialParameters); + if (inner != null) { + return new RegistryListCredentialsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context) { + Response inner = + this + .serviceClient() + .regenerateCredentialWithResponse( + resourceGroupName, registryName, regenerateCredentialParameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryListCredentialsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RegistryUsageListResult listUsages(String resourceGroupName, String registryName) { + RegistryUsageListResultInner inner = this.serviceClient().listUsages(resourceGroupName, registryName); + if (inner != null) { + return new RegistryUsageListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context) { + Response inner = + this.serviceClient().listUsagesWithResponse(resourceGroupName, registryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryUsageListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listPrivateLinkResources(String resourceGroupName, String registryName) { + PagedIterable inner = + this.serviceClient().listPrivateLinkResources(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context) { + PagedIterable inner = + this.serviceClient().listPrivateLinkResources(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public GenerateCredentialsResult generateCredentials( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + GenerateCredentialsResultInner inner = + this.serviceClient().generateCredentials(resourceGroupName, registryName, generateCredentialsParameters); + if (inner != null) { + return new GenerateCredentialsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public GenerateCredentialsResult generateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + GenerateCredentialsResultInner inner = + this + .serviceClient() + .generateCredentials(resourceGroupName, registryName, generateCredentialsParameters, context); + if (inner != null) { + return new GenerateCredentialsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Run scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { + RunInner inner = this.serviceClient().scheduleRun(resourceGroupName, registryName, runRequest); + if (inner != null) { + return new RunImpl(inner, this.manager()); + } else { + return null; + } + } + + public Run scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context) { + RunInner inner = this.serviceClient().scheduleRun(resourceGroupName, registryName, runRequest, context); + if (inner != null) { + return new RunImpl(inner, this.manager()); + } else { + return null; + } + } + + public SourceUploadDefinition getBuildSourceUploadUrl(String resourceGroupName, String registryName) { + SourceUploadDefinitionInner inner = + this.serviceClient().getBuildSourceUploadUrl(resourceGroupName, registryName); + if (inner != null) { + return new SourceUploadDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getBuildSourceUploadUrlWithResponse( + String resourceGroupName, String registryName, Context context) { + Response inner = + this.serviceClient().getBuildSourceUploadUrlWithResponse(resourceGroupName, registryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SourceUploadDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Registry getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, registryName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + this.delete(resourceGroupName, registryName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + this.delete(resourceGroupName, registryName, context); + } + + private RegistriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public RegistryImpl define(String name) { + return new RegistryImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryImpl.java new file mode 100644 index 0000000000000..591cd01b2d4c8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryImpl.java @@ -0,0 +1,450 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.azure.resourcemanager.containerregistry.generated.models.EncryptionProperty; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleBypassOptions; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.containerregistry.generated.models.Policies; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Registry; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryListCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Run; +import com.azure.resourcemanager.containerregistry.generated.models.RunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.SourceUploadDefinition; +import com.azure.resourcemanager.containerregistry.generated.models.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class RegistryImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public IdentityProperties identity() { + return this.innerModel().identity(); + } + + public String loginServer() { + return this.innerModel().loginServer(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Status status() { + return this.innerModel().status(); + } + + public Boolean adminUserEnabled() { + return this.innerModel().adminUserEnabled(); + } + + public NetworkRuleSet networkRuleSet() { + return this.innerModel().networkRuleSet(); + } + + public Policies policies() { + return this.innerModel().policies(); + } + + public EncryptionProperty encryption() { + return this.innerModel().encryption(); + } + + public Boolean dataEndpointEnabled() { + return this.innerModel().dataEndpointEnabled(); + } + + public List dataEndpointHostNames() { + List inner = this.innerModel().dataEndpointHostNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public NetworkRuleBypassOptions networkRuleBypassOptions() { + return this.innerModel().networkRuleBypassOptions(); + } + + public ZoneRedundancy zoneRedundancy() { + return this.innerModel().zoneRedundancy(); + } + + public Boolean anonymousPullEnabled() { + return this.innerModel().anonymousPullEnabled(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public RegistryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private RegistryUpdateParameters updateRegistryUpdateParameters; + + public RegistryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Registry create() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .create(resourceGroupName, registryName, this.innerModel(), Context.NONE); + return this; + } + + public Registry create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .create(resourceGroupName, registryName, this.innerModel(), context); + return this; + } + + RegistryImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new RegistryInner(); + this.serviceManager = serviceManager; + this.registryName = name; + } + + public RegistryImpl update() { + this.updateRegistryUpdateParameters = new RegistryUpdateParameters(); + return this; + } + + public Registry apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .update(resourceGroupName, registryName, updateRegistryUpdateParameters, Context.NONE); + return this; + } + + public Registry apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .update(resourceGroupName, registryName, updateRegistryUpdateParameters, context); + return this; + } + + RegistryImpl( + RegistryInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + } + + public Registry refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE) + .getValue(); + return this; + } + + public Registry refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .getByResourceGroupWithResponse(resourceGroupName, registryName, context) + .getValue(); + return this; + } + + public void importImage(ImportImageParameters parameters) { + serviceManager.registries().importImage(resourceGroupName, registryName, parameters); + } + + public void importImage(ImportImageParameters parameters, Context context) { + serviceManager.registries().importImage(resourceGroupName, registryName, parameters, context); + } + + public RegistryListCredentialsResult listCredentials() { + return serviceManager.registries().listCredentials(resourceGroupName, registryName); + } + + public Response listCredentialsWithResponse(Context context) { + return serviceManager.registries().listCredentialsWithResponse(resourceGroupName, registryName, context); + } + + public RegistryListCredentialsResult regenerateCredential( + RegenerateCredentialParameters regenerateCredentialParameters) { + return serviceManager + .registries() + .regenerateCredential(resourceGroupName, registryName, regenerateCredentialParameters); + } + + public Response regenerateCredentialWithResponse( + RegenerateCredentialParameters regenerateCredentialParameters, Context context) { + return serviceManager + .registries() + .regenerateCredentialWithResponse(resourceGroupName, registryName, regenerateCredentialParameters, context); + } + + public GenerateCredentialsResult generateCredentials(GenerateCredentialsParameters generateCredentialsParameters) { + return serviceManager + .registries() + .generateCredentials(resourceGroupName, registryName, generateCredentialsParameters); + } + + public GenerateCredentialsResult generateCredentials( + GenerateCredentialsParameters generateCredentialsParameters, Context context) { + return serviceManager + .registries() + .generateCredentials(resourceGroupName, registryName, generateCredentialsParameters, context); + } + + public Run scheduleRun(RunRequest runRequest) { + return serviceManager.registries().scheduleRun(resourceGroupName, registryName, runRequest); + } + + public Run scheduleRun(RunRequest runRequest, Context context) { + return serviceManager.registries().scheduleRun(resourceGroupName, registryName, runRequest, context); + } + + public SourceUploadDefinition getBuildSourceUploadUrl() { + return serviceManager.registries().getBuildSourceUploadUrl(resourceGroupName, registryName); + } + + public Response getBuildSourceUploadUrlWithResponse(Context context) { + return serviceManager + .registries() + .getBuildSourceUploadUrlWithResponse(resourceGroupName, registryName, context); + } + + public RegistryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RegistryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RegistryImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateRegistryUpdateParameters.withSku(sku); + return this; + } + } + + public RegistryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateRegistryUpdateParameters.withTags(tags); + return this; + } + } + + public RegistryImpl withIdentity(IdentityProperties identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateRegistryUpdateParameters.withIdentity(identity); + return this; + } + } + + public RegistryImpl withAdminUserEnabled(Boolean adminUserEnabled) { + if (isInCreateMode()) { + this.innerModel().withAdminUserEnabled(adminUserEnabled); + return this; + } else { + this.updateRegistryUpdateParameters.withAdminUserEnabled(adminUserEnabled); + return this; + } + } + + public RegistryImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (isInCreateMode()) { + this.innerModel().withNetworkRuleSet(networkRuleSet); + return this; + } else { + this.updateRegistryUpdateParameters.withNetworkRuleSet(networkRuleSet); + return this; + } + } + + public RegistryImpl withPolicies(Policies policies) { + if (isInCreateMode()) { + this.innerModel().withPolicies(policies); + return this; + } else { + this.updateRegistryUpdateParameters.withPolicies(policies); + return this; + } + } + + public RegistryImpl withEncryption(EncryptionProperty encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateRegistryUpdateParameters.withEncryption(encryption); + return this; + } + } + + public RegistryImpl withDataEndpointEnabled(Boolean dataEndpointEnabled) { + if (isInCreateMode()) { + this.innerModel().withDataEndpointEnabled(dataEndpointEnabled); + return this; + } else { + this.updateRegistryUpdateParameters.withDataEndpointEnabled(dataEndpointEnabled); + return this; + } + } + + public RegistryImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateRegistryUpdateParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public RegistryImpl withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions) { + if (isInCreateMode()) { + this.innerModel().withNetworkRuleBypassOptions(networkRuleBypassOptions); + return this; + } else { + this.updateRegistryUpdateParameters.withNetworkRuleBypassOptions(networkRuleBypassOptions); + return this; + } + } + + public RegistryImpl withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + this.innerModel().withZoneRedundancy(zoneRedundancy); + return this; + } + + public RegistryImpl withAnonymousPullEnabled(Boolean anonymousPullEnabled) { + if (isInCreateMode()) { + this.innerModel().withAnonymousPullEnabled(anonymousPullEnabled); + return this; + } else { + this.updateRegistryUpdateParameters.withAnonymousPullEnabled(anonymousPullEnabled); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryListCredentialsResultImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryListCredentialsResultImpl.java new file mode 100644 index 0000000000000..3900512f2c4a9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryListCredentialsResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryListCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryPassword; +import java.util.Collections; +import java.util.List; + +public final class RegistryListCredentialsResultImpl implements RegistryListCredentialsResult { + private RegistryListCredentialsResultInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + RegistryListCredentialsResultImpl( + RegistryListCredentialsResultInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String username() { + return this.innerModel().username(); + } + + public List passwords() { + List inner = this.innerModel().passwords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RegistryListCredentialsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryNameStatusImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryNameStatusImpl.java new file mode 100644 index 0000000000000..d8feefad1a5fb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryNameStatusImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameStatus; + +public final class RegistryNameStatusImpl implements RegistryNameStatus { + private RegistryNameStatusInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + RegistryNameStatusImpl( + RegistryNameStatusInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public RegistryNameStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryUsageListResultImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryUsageListResultImpl.java new file mode 100644 index 0000000000000..dff452d0f9ae2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryUsageListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUsage; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUsageListResult; +import java.util.Collections; +import java.util.List; + +public final class RegistryUsageListResultImpl implements RegistryUsageListResult { + private RegistryUsageListResultInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + RegistryUsageListResultImpl( + RegistryUsageListResultInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RegistryUsageListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationImpl.java new file mode 100644 index 0000000000000..db8d3c19486ad --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Replication; +import com.azure.resourcemanager.containerregistry.generated.models.ReplicationUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.util.Collections; +import java.util.Map; + +public final class ReplicationImpl implements Replication, Replication.Definition, Replication.Update { + private ReplicationInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Status status() { + return this.innerModel().status(); + } + + public Boolean regionEndpointEnabled() { + return this.innerModel().regionEndpointEnabled(); + } + + public ZoneRedundancy zoneRedundancy() { + return this.innerModel().zoneRedundancy(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ReplicationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String replicationName; + + private ReplicationUpdateParameters updateReplicationUpdateParameters; + + public ReplicationImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public Replication create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .create(resourceGroupName, registryName, replicationName, this.innerModel(), Context.NONE); + return this; + } + + public Replication create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .create(resourceGroupName, registryName, replicationName, this.innerModel(), context); + return this; + } + + ReplicationImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ReplicationInner(); + this.serviceManager = serviceManager; + this.replicationName = name; + } + + public ReplicationImpl update() { + this.updateReplicationUpdateParameters = new ReplicationUpdateParameters(); + return this; + } + + public Replication apply() { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .update( + resourceGroupName, registryName, replicationName, updateReplicationUpdateParameters, Context.NONE); + return this; + } + + public Replication apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .update(resourceGroupName, registryName, replicationName, updateReplicationUpdateParameters, context); + return this; + } + + ReplicationImpl( + ReplicationInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.replicationName = Utils.getValueFromIdByName(innerObject.id(), "replications"); + } + + public Replication refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .getWithResponse(resourceGroupName, registryName, replicationName, Context.NONE) + .getValue(); + return this; + } + + public Replication refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .getWithResponse(resourceGroupName, registryName, replicationName, context) + .getValue(); + return this; + } + + public ReplicationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ReplicationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ReplicationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateReplicationUpdateParameters.withTags(tags); + return this; + } + } + + public ReplicationImpl withRegionEndpointEnabled(Boolean regionEndpointEnabled) { + if (isInCreateMode()) { + this.innerModel().withRegionEndpointEnabled(regionEndpointEnabled); + return this; + } else { + this.updateReplicationUpdateParameters.withRegionEndpointEnabled(regionEndpointEnabled); + return this; + } + } + + public ReplicationImpl withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + this.innerModel().withZoneRedundancy(zoneRedundancy); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsClientImpl.java new file mode 100644 index 0000000000000..6cef9183dbc4c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsClientImpl.java @@ -0,0 +1,1464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ReplicationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import com.azure.resourcemanager.containerregistry.generated.models.ReplicationListResult; +import com.azure.resourcemanager.containerregistry.generated.models.ReplicationUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReplicationsClient. */ +public final class ReplicationsClientImpl implements ReplicationsClient { + private final ClientLogger logger = new ClientLogger(ReplicationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ReplicationsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ReplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientReplications to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface ReplicationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/replications/{replicationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("replicationName") String replicationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/replications/{replicationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("replicationName") String replicationName, + @BodyParam("application/json") ReplicationInner replication, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/replications/{replicationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("replicationName") String replicationName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/replications/{replicationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("replicationName") String replicationName, + @BodyParam("application/json") ReplicationUpdateParameters replicationUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/replications") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String replicationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String replicationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String replicationName) { + return getWithResponseAsync(resourceGroupName, registryName, replicationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationInner get(String resourceGroupName, String registryName, String replicationName) { + return getAsync(resourceGroupName, registryName, replicationName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, replicationName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + if (replication == null) { + return Mono.error(new IllegalArgumentException("Parameter replication is required and cannot be null.")); + } else { + replication.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + replication, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + if (replication == null) { + return Mono.error(new IllegalArgumentException("Parameter replication is required and cannot be null.")); + } else { + replication.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + replication, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ReplicationInner> beginCreateAsync( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, replicationName, replication); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ReplicationInner.class, ReplicationInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ReplicationInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, replicationName, replication, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ReplicationInner.class, ReplicationInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ReplicationInner> beginCreate( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateAsync(resourceGroupName, registryName, replicationName, replication).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ReplicationInner> beginCreate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, replicationName, replication, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateAsync(resourceGroupName, registryName, replicationName, replication) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, replicationName, replication, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationInner create( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createAsync(resourceGroupName, registryName, replicationName, replication).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationInner create( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + return createAsync(resourceGroupName, registryName, replicationName, replication, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String replicationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String replicationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String replicationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, replicationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String replicationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, replicationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName) { + return beginDeleteAsync(resourceGroupName, registryName, replicationName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, replicationName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String replicationName) { + return beginDeleteAsync(resourceGroupName, registryName, replicationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String replicationName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, replicationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String replicationName) { + deleteAsync(resourceGroupName, registryName, replicationName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String replicationName, Context context) { + deleteAsync(resourceGroupName, registryName, replicationName, context).block(); + } + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + if (replicationUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicationUpdateParameters is required and cannot be null.")); + } else { + replicationUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + replicationUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + if (replicationUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicationUpdateParameters is required and cannot be null.")); + } else { + replicationUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + replicationUpdateParameters, + accept, + context); + } + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ReplicationInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ReplicationInner.class, ReplicationInner.class, Context.NONE); + } + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ReplicationInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, registryName, replicationName, replicationUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ReplicationInner.class, ReplicationInner.class, context); + } + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ReplicationInner> beginUpdate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters) + .getSyncPoller(); + } + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ReplicationInner> beginUpdate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters, context) + .getSyncPoller(); + } + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationInner update( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + return updateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters).block(); + } + + /** + * 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 replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationInner update( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsImpl.java new file mode 100644 index 0000000000000..970404334ba9c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ReplicationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import com.azure.resourcemanager.containerregistry.generated.models.Replication; +import com.azure.resourcemanager.containerregistry.generated.models.Replications; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationsImpl implements Replications { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationsImpl.class); + + private final ReplicationsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ReplicationsImpl( + ReplicationsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Replication get(String resourceGroupName, String registryName, String replicationName) { + ReplicationInner inner = this.serviceClient().get(resourceGroupName, registryName, replicationName); + if (inner != null) { + return new ReplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, replicationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String replicationName) { + this.serviceClient().delete(resourceGroupName, registryName, replicationName); + } + + public void delete(String resourceGroupName, String registryName, String replicationName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, replicationName, context); + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ReplicationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new ReplicationImpl(inner1, this.manager())); + } + + public Replication getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String replicationName = Utils.getValueFromIdByName(id, "replications"); + if (replicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replications'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, replicationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String replicationName = Utils.getValueFromIdByName(id, "replications"); + if (replicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replications'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, replicationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String replicationName = Utils.getValueFromIdByName(id, "replications"); + if (replicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replications'.", id))); + } + this.delete(resourceGroupName, registryName, replicationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String replicationName = Utils.getValueFromIdByName(id, "replications"); + if (replicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replications'.", id))); + } + this.delete(resourceGroupName, registryName, replicationName, context); + } + + private ReplicationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ReplicationImpl define(String name) { + return new ReplicationImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunGetLogResultImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunGetLogResultImpl.java new file mode 100644 index 0000000000000..dee1e57e62bf9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunGetLogResultImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunGetLogResultInner; +import com.azure.resourcemanager.containerregistry.generated.models.RunGetLogResult; + +public final class RunGetLogResultImpl implements RunGetLogResult { + private RunGetLogResultInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + RunGetLogResultImpl( + RunGetLogResultInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String logLink() { + return this.innerModel().logLink(); + } + + public String logArtifactLink() { + return this.innerModel().logArtifactLink(); + } + + public RunGetLogResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunImpl.java new file mode 100644 index 0000000000000..3b0e81494fcaf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ImageDescriptor; +import com.azure.resourcemanager.containerregistry.generated.models.ImageUpdateTrigger; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Run; +import com.azure.resourcemanager.containerregistry.generated.models.RunStatus; +import com.azure.resourcemanager.containerregistry.generated.models.RunType; +import com.azure.resourcemanager.containerregistry.generated.models.SourceTriggerDescriptor; +import com.azure.resourcemanager.containerregistry.generated.models.TimerTriggerDescriptor; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class RunImpl implements Run { + private RunInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + RunImpl( + RunInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String runId() { + return this.innerModel().runId(); + } + + public RunStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime lastUpdatedTime() { + return this.innerModel().lastUpdatedTime(); + } + + public RunType runType() { + return this.innerModel().runType(); + } + + public String agentPoolName() { + return this.innerModel().agentPoolName(); + } + + public OffsetDateTime createTime() { + return this.innerModel().createTime(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime finishTime() { + return this.innerModel().finishTime(); + } + + public List outputImages() { + List inner = this.innerModel().outputImages(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String task() { + return this.innerModel().task(); + } + + public ImageUpdateTrigger imageUpdateTrigger() { + return this.innerModel().imageUpdateTrigger(); + } + + public SourceTriggerDescriptor sourceTrigger() { + return this.innerModel().sourceTrigger(); + } + + public TimerTriggerDescriptor timerTrigger() { + return this.innerModel().timerTrigger(); + } + + public PlatformProperties platform() { + return this.innerModel().platform(); + } + + public AgentProperties agentConfiguration() { + return this.innerModel().agentConfiguration(); + } + + public String sourceRegistryAuth() { + return this.innerModel().sourceRegistryAuth(); + } + + public List customRegistries() { + List inner = this.innerModel().customRegistries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String runErrorMessage() { + return this.innerModel().runErrorMessage(); + } + + public String updateTriggerToken() { + return this.innerModel().updateTriggerToken(); + } + + public ImageDescriptor logArtifact() { + return this.innerModel().logArtifact(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean isArchiveEnabled() { + return this.innerModel().isArchiveEnabled(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RunInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunsClientImpl.java new file mode 100644 index 0000000000000..4dc8cd64b6ced --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunsClientImpl.java @@ -0,0 +1,1339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.RunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunGetLogResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.generated.models.RunListResult; +import com.azure.resourcemanager.containerregistry.generated.models.RunUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RunsClient. */ +public final class RunsClientImpl implements RunsClient { + private final ClientLogger logger = new ClientLogger(RunsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RunsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RunsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = RestProxy.create(RunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientRuns to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface RunsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/runs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/runs/{runId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("runId") String runId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/runs/{runId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("runId") String runId, + @BodyParam("application/json") RunUpdateParameters runUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/runs/{runId}/listLogSasUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogSasUrl( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("runId") String runId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/runs/{runId}/cancel") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("runId") String runId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed + * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed + * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed + * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String filter, Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, filter, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, filter, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed + * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, filter, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, filter, top)); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed + * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String filter, Integer top, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, filter, top, context)); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, String runId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runId == null) { + return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + runId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String runId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runId == null) { + return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + runId, + accept, + context); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String runId) { + return getWithResponseAsync(resourceGroupName, registryName, runId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunInner get(String resourceGroupName, String registryName, String runId) { + return getAsync(resourceGroupName, registryName, runId).block(); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String runId, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, runId, context).block(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runId == null) { + return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); + } + if (runUpdateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter runUpdateParameters is required and cannot be null.")); + } else { + runUpdateParameters.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + runId, + runUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String runId, + RunUpdateParameters runUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runId == null) { + return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); + } + if (runUpdateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter runUpdateParameters is required and cannot be null.")); + } else { + runUpdateParameters.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + runId, + runUpdateParameters, + accept, + context); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RunInner> beginUpdateAsync( + String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, runId, runUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RunInner.class, RunInner.class, Context.NONE); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RunInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String runId, + RunUpdateParameters runUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, runId, runUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RunInner.class, RunInner.class, context); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RunInner> beginUpdate( + String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters).getSyncPoller(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RunInner> beginUpdate( + String resourceGroupName, + String registryName, + String runId, + RunUpdateParameters runUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters, context).getSyncPoller(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String runId, + RunUpdateParameters runUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunInner update( + String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { + return updateAsync(resourceGroupName, registryName, runId, runUpdateParameters).block(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunInner update( + String resourceGroupName, + String registryName, + String runId, + RunUpdateParameters runUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, runId, runUpdateParameters, context).block(); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogSasUrlWithResponseAsync( + String resourceGroupName, String registryName, String runId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runId == null) { + return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLogSasUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + runId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogSasUrlWithResponseAsync( + String resourceGroupName, String registryName, String runId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runId == null) { + return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getLogSasUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + runId, + accept, + context); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogSasUrlAsync(String resourceGroupName, String registryName, String runId) { + return getLogSasUrlWithResponseAsync(resourceGroupName, registryName, runId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId) { + return getLogSasUrlAsync(resourceGroupName, registryName, runId).block(); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogSasUrlWithResponse( + String resourceGroupName, String registryName, String runId, Context context) { + return getLogSasUrlWithResponseAsync(resourceGroupName, registryName, runId, context).block(); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceGroupName, String registryName, String runId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runId == null) { + return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + runId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceGroupName, String registryName, String runId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runId == null) { + return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancel( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + runId, + accept, + context); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginCancelAsync( + String resourceGroupName, String registryName, String runId) { + Mono>> mono = cancelWithResponseAsync(resourceGroupName, registryName, runId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginCancelAsync( + String resourceGroupName, String registryName, String runId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + cancelWithResponseAsync(resourceGroupName, registryName, runId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCancel(String resourceGroupName, String registryName, String runId) { + return beginCancelAsync(resourceGroupName, registryName, runId).getSyncPoller(); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCancel( + String resourceGroupName, String registryName, String runId, Context context) { + return beginCancelAsync(resourceGroupName, registryName, runId, context).getSyncPoller(); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceGroupName, String registryName, String runId) { + return beginCancelAsync(resourceGroupName, registryName, runId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceGroupName, String registryName, String runId, Context context) { + return beginCancelAsync(resourceGroupName, registryName, runId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel(String resourceGroupName, String registryName, String runId) { + cancelAsync(resourceGroupName, registryName, runId).block(); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel(String resourceGroupName, String registryName, String runId, Context context) { + cancelAsync(resourceGroupName, registryName, runId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of runs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of runs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunsImpl.java new file mode 100644 index 0000000000000..a53ba2bc20bc6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunsImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.RunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunGetLogResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.generated.models.Run; +import com.azure.resourcemanager.containerregistry.generated.models.RunGetLogResult; +import com.azure.resourcemanager.containerregistry.generated.models.RunUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Runs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RunsImpl implements Runs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunsImpl.class); + + private final RunsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public RunsImpl( + RunsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new RunImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, String filter, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, filter, top, context); + return Utils.mapPage(inner, inner1 -> new RunImpl(inner1, this.manager())); + } + + public Run get(String resourceGroupName, String registryName, String runId) { + RunInner inner = this.serviceClient().get(resourceGroupName, registryName, runId); + if (inner != null) { + return new RunImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String registryName, String runId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, runId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RunImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Run update( + String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { + RunInner inner = this.serviceClient().update(resourceGroupName, registryName, runId, runUpdateParameters); + if (inner != null) { + return new RunImpl(inner, this.manager()); + } else { + return null; + } + } + + public Run update( + String resourceGroupName, + String registryName, + String runId, + RunUpdateParameters runUpdateParameters, + Context context) { + RunInner inner = + this.serviceClient().update(resourceGroupName, registryName, runId, runUpdateParameters, context); + if (inner != null) { + return new RunImpl(inner, this.manager()); + } else { + return null; + } + } + + public RunGetLogResult getLogSasUrl(String resourceGroupName, String registryName, String runId) { + RunGetLogResultInner inner = this.serviceClient().getLogSasUrl(resourceGroupName, registryName, runId); + if (inner != null) { + return new RunGetLogResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLogSasUrlWithResponse( + String resourceGroupName, String registryName, String runId, Context context) { + Response inner = + this.serviceClient().getLogSasUrlWithResponse(resourceGroupName, registryName, runId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RunGetLogResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void cancel(String resourceGroupName, String registryName, String runId) { + this.serviceClient().cancel(resourceGroupName, registryName, runId); + } + + public void cancel(String resourceGroupName, String registryName, String runId, Context context) { + this.serviceClient().cancel(resourceGroupName, registryName, runId, context); + } + + private RunsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapImpl.java new file mode 100644 index 0000000000000..e1bcc6feac0f1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMap; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMapUpdateParameters; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ScopeMapImpl implements ScopeMap, ScopeMap.Definition, ScopeMap.Update { + private ScopeMapInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ScopeMapInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String scopeMapName; + + private ScopeMapUpdateParameters updateScopeMapUpdateParameters; + + public ScopeMapImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public ScopeMap create() { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .create(resourceGroupName, registryName, scopeMapName, this.innerModel(), Context.NONE); + return this; + } + + public ScopeMap create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .create(resourceGroupName, registryName, scopeMapName, this.innerModel(), context); + return this; + } + + ScopeMapImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ScopeMapInner(); + this.serviceManager = serviceManager; + this.scopeMapName = name; + } + + public ScopeMapImpl update() { + this.updateScopeMapUpdateParameters = new ScopeMapUpdateParameters(); + return this; + } + + public ScopeMap apply() { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .update(resourceGroupName, registryName, scopeMapName, updateScopeMapUpdateParameters, Context.NONE); + return this; + } + + public ScopeMap apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .update(resourceGroupName, registryName, scopeMapName, updateScopeMapUpdateParameters, context); + return this; + } + + ScopeMapImpl( + ScopeMapInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.scopeMapName = Utils.getValueFromIdByName(innerObject.id(), "scopeMaps"); + } + + public ScopeMap refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .getWithResponse(resourceGroupName, registryName, scopeMapName, Context.NONE) + .getValue(); + return this; + } + + public ScopeMap refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .getWithResponse(resourceGroupName, registryName, scopeMapName, context) + .getValue(); + return this; + } + + public ScopeMapImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateScopeMapUpdateParameters.withDescription(description); + return this; + } + } + + public ScopeMapImpl withActions(List actions) { + if (isInCreateMode()) { + this.innerModel().withActions(actions); + return this; + } else { + this.updateScopeMapUpdateParameters.withActions(actions); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsClientImpl.java new file mode 100644 index 0000000000000..be028fc9462a2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsClientImpl.java @@ -0,0 +1,1457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ScopeMapsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMapListResult; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMapUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ScopeMapsClient. */ +public final class ScopeMapsClientImpl implements ScopeMapsClient { + private final ClientLogger logger = new ClientLogger(ScopeMapsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ScopeMapsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ScopeMapsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeMapsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ScopeMapsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientScopeMaps to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface ScopeMapsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scopeMaps/{scopeMapName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("scopeMapName") String scopeMapName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scopeMaps/{scopeMapName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("scopeMapName") String scopeMapName, + @BodyParam("application/json") ScopeMapInner scopeMapCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scopeMaps/{scopeMapName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("scopeMapName") String scopeMapName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scopeMaps/{scopeMapName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("scopeMapName") String scopeMapName, + @BodyParam("application/json") ScopeMapUpdateParameters scopeMapUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scopeMaps") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String scopeMapName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + accept, + context); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String scopeMapName) { + return getWithResponseAsync(resourceGroupName, registryName, scopeMapName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeMapInner get(String resourceGroupName, String registryName, String scopeMapName) { + return getAsync(resourceGroupName, registryName, scopeMapName).block(); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, scopeMapName, context).block(); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + if (scopeMapCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter scopeMapCreateParameters is required and cannot be null.")); + } else { + scopeMapCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + scopeMapCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + if (scopeMapCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter scopeMapCreateParameters is required and cannot be null.")); + } else { + scopeMapCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + scopeMapCreateParameters, + accept, + context); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ScopeMapInner> beginCreateAsync( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ScopeMapInner.class, ScopeMapInner.class, Context.NONE); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ScopeMapInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ScopeMapInner.class, ScopeMapInner.class, context); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ScopeMapInner> beginCreate( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters) + .getSyncPoller(); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ScopeMapInner> beginCreate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeMapInner create( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return createAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters).block(); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeMapInner create( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, context).block(); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String scopeMapName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + context); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String scopeMapName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, scopeMapName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, scopeMapName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String scopeMapName) { + return beginDeleteAsync(resourceGroupName, registryName, scopeMapName).getSyncPoller(); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, scopeMapName, context).getSyncPoller(); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String scopeMapName) { + return beginDeleteAsync(resourceGroupName, registryName, scopeMapName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, scopeMapName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String scopeMapName) { + deleteAsync(resourceGroupName, registryName, scopeMapName).block(); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String scopeMapName, Context context) { + deleteAsync(resourceGroupName, registryName, scopeMapName, context).block(); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + if (scopeMapUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter scopeMapUpdateParameters is required and cannot be null.")); + } else { + scopeMapUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + scopeMapUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + if (scopeMapUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter scopeMapUpdateParameters is required and cannot be null.")); + } else { + scopeMapUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + scopeMapUpdateParameters, + accept, + context); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ScopeMapInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ScopeMapInner.class, ScopeMapInner.class, Context.NONE); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ScopeMapInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ScopeMapInner.class, ScopeMapInner.class, context); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ScopeMapInner> beginUpdate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters) + .getSyncPoller(); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ScopeMapInner> beginUpdate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeMapInner update( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + return updateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters).block(); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeMapInner update( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, context).block(); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsImpl.java new file mode 100644 index 0000000000000..cf91334297588 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ScopeMapsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMap; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMaps; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ScopeMapsImpl implements ScopeMaps { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScopeMapsImpl.class); + + private final ScopeMapsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ScopeMapsImpl( + ScopeMapsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ScopeMap get(String resourceGroupName, String registryName, String scopeMapName) { + ScopeMapInner inner = this.serviceClient().get(resourceGroupName, registryName, scopeMapName); + if (inner != null) { + return new ScopeMapImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, scopeMapName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ScopeMapImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String scopeMapName) { + this.serviceClient().delete(resourceGroupName, registryName, scopeMapName); + } + + public void delete(String resourceGroupName, String registryName, String scopeMapName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, scopeMapName, context); + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ScopeMapImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new ScopeMapImpl(inner1, this.manager())); + } + + public ScopeMap getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String scopeMapName = Utils.getValueFromIdByName(id, "scopeMaps"); + if (scopeMapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeMaps'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, scopeMapName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String scopeMapName = Utils.getValueFromIdByName(id, "scopeMaps"); + if (scopeMapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeMaps'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, scopeMapName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String scopeMapName = Utils.getValueFromIdByName(id, "scopeMaps"); + if (scopeMapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeMaps'.", id))); + } + this.delete(resourceGroupName, registryName, scopeMapName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String scopeMapName = Utils.getValueFromIdByName(id, "scopeMaps"); + if (scopeMapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeMaps'.", id))); + } + this.delete(resourceGroupName, registryName, scopeMapName, context); + } + + private ScopeMapsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ScopeMapImpl define(String name) { + return new ScopeMapImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/SourceUploadDefinitionImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/SourceUploadDefinitionImpl.java new file mode 100644 index 0000000000000..b6cdbac1f3192 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/SourceUploadDefinitionImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.SourceUploadDefinitionInner; +import com.azure.resourcemanager.containerregistry.generated.models.SourceUploadDefinition; + +public final class SourceUploadDefinitionImpl implements SourceUploadDefinition { + private SourceUploadDefinitionInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + SourceUploadDefinitionImpl( + SourceUploadDefinitionInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String uploadUrl() { + return this.innerModel().uploadUrl(); + } + + public String relativePath() { + return this.innerModel().relativePath(); + } + + public SourceUploadDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskImpl.java new file mode 100644 index 0000000000000..8db281aa607e2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskImpl.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskInner; +import com.azure.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Task; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStatus; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStepProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStepUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.TaskUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.TriggerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TriggerUpdateParameters; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class TaskImpl implements Task, Task.Definition, Task.Update { + private TaskInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IdentityProperties identity() { + return this.innerModel().identity(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public TaskStatus status() { + return this.innerModel().status(); + } + + public PlatformProperties platform() { + return this.innerModel().platform(); + } + + public AgentProperties agentConfiguration() { + return this.innerModel().agentConfiguration(); + } + + public String agentPoolName() { + return this.innerModel().agentPoolName(); + } + + public Integer timeout() { + return this.innerModel().timeout(); + } + + public TaskStepProperties step() { + return this.innerModel().step(); + } + + public TriggerProperties trigger() { + return this.innerModel().trigger(); + } + + public Credentials credentials() { + return this.innerModel().credentials(); + } + + public String logTemplate() { + return this.innerModel().logTemplate(); + } + + public Boolean isSystemTask() { + return this.innerModel().isSystemTask(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public TaskInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String taskName; + + private TaskUpdateParameters updateTaskUpdateParameters; + + public TaskImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public Task create() { + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .create(resourceGroupName, registryName, taskName, this.innerModel(), Context.NONE); + return this; + } + + public Task create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .create(resourceGroupName, registryName, taskName, this.innerModel(), context); + return this; + } + + TaskImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new TaskInner(); + this.serviceManager = serviceManager; + this.taskName = name; + } + + public TaskImpl update() { + this.updateTaskUpdateParameters = new TaskUpdateParameters(); + return this; + } + + public Task apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .update(resourceGroupName, registryName, taskName, updateTaskUpdateParameters, Context.NONE); + return this; + } + + public Task apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .update(resourceGroupName, registryName, taskName, updateTaskUpdateParameters, context); + return this; + } + + TaskImpl( + TaskInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.taskName = Utils.getValueFromIdByName(innerObject.id(), "tasks"); + } + + public Task refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .getWithResponse(resourceGroupName, registryName, taskName, Context.NONE) + .getValue(); + return this; + } + + public Task refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .getWithResponse(resourceGroupName, registryName, taskName, context) + .getValue(); + return this; + } + + public Task getDetails() { + return serviceManager.tasks().getDetails(resourceGroupName, registryName, taskName); + } + + public Response getDetailsWithResponse(Context context) { + return serviceManager.tasks().getDetailsWithResponse(resourceGroupName, registryName, taskName, context); + } + + public TaskImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public TaskImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public TaskImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateTaskUpdateParameters.withTags(tags); + return this; + } + } + + public TaskImpl withIdentity(IdentityProperties identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateTaskUpdateParameters.withIdentity(identity); + return this; + } + } + + public TaskImpl withStatus(TaskStatus status) { + if (isInCreateMode()) { + this.innerModel().withStatus(status); + return this; + } else { + this.updateTaskUpdateParameters.withStatus(status); + return this; + } + } + + public TaskImpl withPlatform(PlatformProperties platform) { + this.innerModel().withPlatform(platform); + return this; + } + + public TaskImpl withAgentConfiguration(AgentProperties agentConfiguration) { + if (isInCreateMode()) { + this.innerModel().withAgentConfiguration(agentConfiguration); + return this; + } else { + this.updateTaskUpdateParameters.withAgentConfiguration(agentConfiguration); + return this; + } + } + + public TaskImpl withAgentPoolName(String agentPoolName) { + if (isInCreateMode()) { + this.innerModel().withAgentPoolName(agentPoolName); + return this; + } else { + this.updateTaskUpdateParameters.withAgentPoolName(agentPoolName); + return this; + } + } + + public TaskImpl withTimeout(Integer timeout) { + if (isInCreateMode()) { + this.innerModel().withTimeout(timeout); + return this; + } else { + this.updateTaskUpdateParameters.withTimeout(timeout); + return this; + } + } + + public TaskImpl withStep(TaskStepProperties step) { + this.innerModel().withStep(step); + return this; + } + + public TaskImpl withTrigger(TriggerProperties trigger) { + this.innerModel().withTrigger(trigger); + return this; + } + + public TaskImpl withCredentials(Credentials credentials) { + if (isInCreateMode()) { + this.innerModel().withCredentials(credentials); + return this; + } else { + this.updateTaskUpdateParameters.withCredentials(credentials); + return this; + } + } + + public TaskImpl withLogTemplate(String logTemplate) { + if (isInCreateMode()) { + this.innerModel().withLogTemplate(logTemplate); + return this; + } else { + this.updateTaskUpdateParameters.withLogTemplate(logTemplate); + return this; + } + } + + public TaskImpl withIsSystemTask(Boolean isSystemTask) { + this.innerModel().withIsSystemTask(isSystemTask); + return this; + } + + public TaskImpl withPlatform(PlatformUpdateParameters platform) { + this.updateTaskUpdateParameters.withPlatform(platform); + return this; + } + + public TaskImpl withStep(TaskStepUpdateParameters step) { + this.updateTaskUpdateParameters.withStep(step); + return this; + } + + public TaskImpl withTrigger(TriggerUpdateParameters trigger) { + this.updateTaskUpdateParameters.withTrigger(trigger); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunImpl.java new file mode 100644 index 0000000000000..dc2f0858b920d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskRunInner; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Run; +import com.azure.resourcemanager.containerregistry.generated.models.RunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRun; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRunUpdateParameters; +import java.util.Map; + +public final class TaskRunImpl implements TaskRun, TaskRun.Definition, TaskRun.Update { + private TaskRunInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public IdentityProperties identity() { + return this.innerModel().identity(); + } + + public String location() { + return this.innerModel().location(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public RunRequest runRequest() { + return this.innerModel().runRequest(); + } + + public Run runResult() { + RunInner inner = this.innerModel().runResult(); + if (inner != null) { + return new RunImpl(inner, this.manager()); + } else { + return null; + } + } + + public String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public TaskRunInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String taskRunName; + + private TaskRunUpdateParameters updateUpdateParameters; + + public TaskRunImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public TaskRun create() { + this.innerObject = + serviceManager + .serviceClient() + .getTaskRuns() + .create(resourceGroupName, registryName, taskRunName, this.innerModel(), Context.NONE); + return this; + } + + public TaskRun create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTaskRuns() + .create(resourceGroupName, registryName, taskRunName, this.innerModel(), context); + return this; + } + + TaskRunImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new TaskRunInner(); + this.serviceManager = serviceManager; + this.taskRunName = name; + } + + public TaskRunImpl update() { + this.updateUpdateParameters = new TaskRunUpdateParameters(); + return this; + } + + public TaskRun apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTaskRuns() + .update(resourceGroupName, registryName, taskRunName, updateUpdateParameters, Context.NONE); + return this; + } + + public TaskRun apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTaskRuns() + .update(resourceGroupName, registryName, taskRunName, updateUpdateParameters, context); + return this; + } + + TaskRunImpl( + TaskRunInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.taskRunName = Utils.getValueFromIdByName(innerObject.id(), "taskRuns"); + } + + public TaskRun refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTaskRuns() + .getWithResponse(resourceGroupName, registryName, taskRunName, Context.NONE) + .getValue(); + return this; + } + + public TaskRun refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTaskRuns() + .getWithResponse(resourceGroupName, registryName, taskRunName, context) + .getValue(); + return this; + } + + public TaskRun getDetails() { + return serviceManager.taskRuns().getDetails(resourceGroupName, registryName, taskRunName); + } + + public Response getDetailsWithResponse(Context context) { + return serviceManager.taskRuns().getDetailsWithResponse(resourceGroupName, registryName, taskRunName, context); + } + + public TaskRunImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public TaskRunImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public TaskRunImpl withIdentity(IdentityProperties identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateUpdateParameters.withIdentity(identity); + return this; + } + } + + public TaskRunImpl withRunRequest(RunRequest runRequest) { + if (isInCreateMode()) { + this.innerModel().withRunRequest(runRequest); + return this; + } else { + this.updateUpdateParameters.withRunRequest(runRequest); + return this; + } + } + + public TaskRunImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } else { + this.updateUpdateParameters.withForceUpdateTag(forceUpdateTag); + return this; + } + } + + public TaskRunImpl withTags(Map tags) { + this.updateUpdateParameters.withTags(tags); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunsClientImpl.java new file mode 100644 index 0000000000000..51d4db7b13b26 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunsClientImpl.java @@ -0,0 +1,1597 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.TaskRunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskRunInner; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRunListResult; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRunUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TaskRunsClient. */ +public final class TaskRunsClientImpl implements TaskRunsClient { + private final ClientLogger logger = new ClientLogger(TaskRunsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TaskRunsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of TaskRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TaskRunsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = RestProxy.create(TaskRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientTaskRuns to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface TaskRunsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/taskRuns/{taskRunName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("taskRunName") String taskRunName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/taskRuns/{taskRunName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("taskRunName") String taskRunName, + @BodyParam("application/json") TaskRunInner taskRun, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/taskRuns/{taskRunName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("taskRunName") String taskRunName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/taskRuns/{taskRunName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("taskRunName") String taskRunName, + @BodyParam("application/json") TaskRunUpdateParameters updateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/taskRuns/{taskRunName}/listDetails") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDetails( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("taskRunName") String taskRunName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/taskRuns") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the detailed information for a given task run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String taskRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskRunName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the detailed information for a given task run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String taskRunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskRunName, + accept, + context); + } + + /** + * Gets the detailed information for a given task run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String taskRunName) { + return getWithResponseAsync(resourceGroupName, registryName, taskRunName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the detailed information for a given task run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskRunInner get(String resourceGroupName, String registryName, String taskRunName) { + return getAsync(resourceGroupName, registryName, taskRunName).block(); + } + + /** + * Gets the detailed information for a given task run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String taskRunName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, taskRunName, context).block(); + } + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } + if (taskRun == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRun is required and cannot be null.")); + } else { + taskRun.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskRunName, + taskRun, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } + if (taskRun == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRun is required and cannot be null.")); + } else { + taskRun.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskRunName, + taskRun, + accept, + context); + } + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TaskRunInner> beginCreateAsync( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, taskRunName, taskRun); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TaskRunInner.class, TaskRunInner.class, Context.NONE); + } + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TaskRunInner> beginCreateAsync( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, taskRunName, taskRun, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TaskRunInner.class, TaskRunInner.class, context); + } + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TaskRunInner> beginCreate( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + return beginCreateAsync(resourceGroupName, registryName, taskRunName, taskRun).getSyncPoller(); + } + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TaskRunInner> beginCreate( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, Context context) { + return beginCreateAsync(resourceGroupName, registryName, taskRunName, taskRun, context).getSyncPoller(); + } + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + return beginCreateAsync(resourceGroupName, registryName, taskRunName, taskRun) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, Context context) { + return beginCreateAsync(resourceGroupName, registryName, taskRunName, taskRun, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskRunInner create( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + return createAsync(resourceGroupName, registryName, taskRunName, taskRun).block(); + } + + /** + * Creates a task run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskRunInner create( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, Context context) { + return createAsync(resourceGroupName, registryName, taskRunName, taskRun, context).block(); + } + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String taskRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskRunName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String taskRunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskRunName, + accept, + context); + } + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String taskRunName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, taskRunName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String taskRunName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, taskRunName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String taskRunName) { + return beginDeleteAsync(resourceGroupName, registryName, taskRunName).getSyncPoller(); + } + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String taskRunName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, taskRunName, context).getSyncPoller(); + } + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String taskRunName) { + return beginDeleteAsync(resourceGroupName, registryName, taskRunName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String taskRunName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, taskRunName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String taskRunName) { + deleteAsync(resourceGroupName, registryName, taskRunName).block(); + } + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String taskRunName, Context context) { + deleteAsync(resourceGroupName, registryName, taskRunName, context).block(); + } + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } + if (updateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateParameters is required and cannot be null.")); + } else { + updateParameters.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskRunName, + updateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String taskRunName, + TaskRunUpdateParameters updateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } + if (updateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateParameters is required and cannot be null.")); + } else { + updateParameters.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskRunName, + updateParameters, + accept, + context); + } + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TaskRunInner> beginUpdateAsync( + String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, taskRunName, updateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TaskRunInner.class, TaskRunInner.class, Context.NONE); + } + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TaskRunInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String taskRunName, + TaskRunUpdateParameters updateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, taskRunName, updateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TaskRunInner.class, TaskRunInner.class, context); + } + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TaskRunInner> beginUpdate( + String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, taskRunName, updateParameters).getSyncPoller(); + } + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TaskRunInner> beginUpdate( + String resourceGroupName, + String registryName, + String taskRunName, + TaskRunUpdateParameters updateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, taskRunName, updateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, taskRunName, updateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String taskRunName, + TaskRunUpdateParameters updateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, taskRunName, updateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskRunInner update( + String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + return updateAsync(resourceGroupName, registryName, taskRunName, updateParameters).block(); + } + + /** + * Updates a task run with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskRunInner update( + String resourceGroupName, + String registryName, + String taskRunName, + TaskRunUpdateParameters updateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, taskRunName, updateParameters, context).block(); + } + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDetailsWithResponseAsync( + String resourceGroupName, String registryName, String taskRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDetails( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskRunName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDetailsWithResponseAsync( + String resourceGroupName, String registryName, String taskRunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDetails( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskRunName, + accept, + context); + } + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDetailsAsync(String resourceGroupName, String registryName, String taskRunName) { + return getDetailsWithResponseAsync(resourceGroupName, registryName, taskRunName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskRunInner getDetails(String resourceGroupName, String registryName, String taskRunName) { + return getDetailsAsync(resourceGroupName, registryName, taskRunName).block(); + } + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDetailsWithResponse( + String resourceGroupName, String registryName, String taskRunName, Context context) { + return getDetailsWithResponseAsync(resourceGroupName, registryName, taskRunName, context).block(); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunsImpl.java new file mode 100644 index 0000000000000..b7a7ce6b17505 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunsImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.TaskRunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskRunInner; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRun; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRuns; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TaskRunsImpl implements TaskRuns { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskRunsImpl.class); + + private final TaskRunsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public TaskRunsImpl( + TaskRunsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public TaskRun get(String resourceGroupName, String registryName, String taskRunName) { + TaskRunInner inner = this.serviceClient().get(resourceGroupName, registryName, taskRunName); + if (inner != null) { + return new TaskRunImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String taskRunName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, taskRunName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TaskRunImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String taskRunName) { + this.serviceClient().delete(resourceGroupName, registryName, taskRunName); + } + + public void delete(String resourceGroupName, String registryName, String taskRunName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, taskRunName, context); + } + + public TaskRun getDetails(String resourceGroupName, String registryName, String taskRunName) { + TaskRunInner inner = this.serviceClient().getDetails(resourceGroupName, registryName, taskRunName); + if (inner != null) { + return new TaskRunImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDetailsWithResponse( + String resourceGroupName, String registryName, String taskRunName, Context context) { + Response inner = + this.serviceClient().getDetailsWithResponse(resourceGroupName, registryName, taskRunName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TaskRunImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new TaskRunImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new TaskRunImpl(inner1, this.manager())); + } + + public TaskRun getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String taskRunName = Utils.getValueFromIdByName(id, "taskRuns"); + if (taskRunName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, taskRunName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String taskRunName = Utils.getValueFromIdByName(id, "taskRuns"); + if (taskRunName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, taskRunName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String taskRunName = Utils.getValueFromIdByName(id, "taskRuns"); + if (taskRunName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskRuns'.", id))); + } + this.delete(resourceGroupName, registryName, taskRunName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String taskRunName = Utils.getValueFromIdByName(id, "taskRuns"); + if (taskRunName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskRuns'.", id))); + } + this.delete(resourceGroupName, registryName, taskRunName, context); + } + + private TaskRunsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public TaskRunImpl define(String name) { + return new TaskRunImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TasksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TasksClientImpl.java new file mode 100644 index 0000000000000..a8468ebfc924d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TasksClientImpl.java @@ -0,0 +1,1620 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.TasksClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskInner; +import com.azure.resourcemanager.containerregistry.generated.models.TaskListResult; +import com.azure.resourcemanager.containerregistry.generated.models.TaskUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TasksClient. */ +public final class TasksClientImpl implements TasksClient { + private final ClientLogger logger = new ClientLogger(TasksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TasksService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of TasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TasksClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = RestProxy.create(TasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientTasks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface TasksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tasks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tasks/{taskName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("taskName") String taskName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tasks/{taskName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("taskName") String taskName, + @BodyParam("application/json") TaskInner taskCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tasks/{taskName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("taskName") String taskName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tasks/{taskName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("taskName") String taskName, + @BodyParam("application/json") TaskUpdateParameters taskUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tasks/{taskName}/listDetails") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDetails( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @PathParam("taskName") String taskName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String taskName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String taskName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskName, + accept, + context); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String taskName) { + return getWithResponseAsync(resourceGroupName, registryName, taskName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskInner get(String resourceGroupName, String registryName, String taskName) { + return getAsync(resourceGroupName, registryName, taskName).block(); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String taskName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, taskName, context).block(); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (taskCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter taskCreateParameters is required and cannot be null.")); + } else { + taskCreateParameters.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskName, + taskCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String taskName, + TaskInner taskCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (taskCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter taskCreateParameters is required and cannot be null.")); + } else { + taskCreateParameters.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskName, + taskCreateParameters, + accept, + context); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TaskInner> beginCreateAsync( + String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TaskInner.class, TaskInner.class, Context.NONE); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TaskInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String taskName, + TaskInner taskCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TaskInner.class, TaskInner.class, context); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TaskInner> beginCreate( + String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters).getSyncPoller(); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TaskInner> beginCreate( + String resourceGroupName, + String registryName, + String taskName, + TaskInner taskCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String taskName, + TaskInner taskCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskInner create( + String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return createAsync(resourceGroupName, registryName, taskName, taskCreateParameters).block(); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskInner create( + String resourceGroupName, + String registryName, + String taskName, + TaskInner taskCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context).block(); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String taskName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String taskName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskName, + accept, + context); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String taskName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, taskName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String taskName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, taskName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String taskName) { + return beginDeleteAsync(resourceGroupName, registryName, taskName).getSyncPoller(); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String taskName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, taskName, context).getSyncPoller(); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String taskName) { + return beginDeleteAsync(resourceGroupName, registryName, taskName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String taskName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, taskName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String taskName) { + deleteAsync(resourceGroupName, registryName, taskName).block(); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String taskName, Context context) { + deleteAsync(resourceGroupName, registryName, taskName, context).block(); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (taskUpdateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null.")); + } else { + taskUpdateParameters.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskName, + taskUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String taskName, + TaskUpdateParameters taskUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (taskUpdateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null.")); + } else { + taskUpdateParameters.validate(); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskName, + taskUpdateParameters, + accept, + context); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TaskInner> beginUpdateAsync( + String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TaskInner.class, TaskInner.class, Context.NONE); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TaskInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String taskName, + TaskUpdateParameters taskUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TaskInner.class, TaskInner.class, context); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TaskInner> beginUpdate( + String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).getSyncPoller(); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TaskInner> beginUpdate( + String resourceGroupName, + String registryName, + String taskName, + TaskUpdateParameters taskUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String taskName, + TaskUpdateParameters taskUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskInner update( + String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return updateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).block(); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskInner update( + String resourceGroupName, + String registryName, + String taskName, + TaskUpdateParameters taskUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context).block(); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDetailsWithResponseAsync( + String resourceGroupName, String registryName, String taskName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDetails( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDetailsWithResponseAsync( + String resourceGroupName, String registryName, String taskName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String apiVersion = "2019-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDetails( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + apiVersion, + taskName, + accept, + context); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDetailsAsync(String resourceGroupName, String registryName, String taskName) { + return getDetailsWithResponseAsync(resourceGroupName, registryName, taskName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskInner getDetails(String resourceGroupName, String registryName, String taskName) { + return getDetailsAsync(resourceGroupName, registryName, taskName).block(); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDetailsWithResponse( + String resourceGroupName, String registryName, String taskName, Context context) { + return getDetailsWithResponseAsync(resourceGroupName, registryName, taskName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TasksImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TasksImpl.java new file mode 100644 index 0000000000000..4e3225f1e9fcf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TasksImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.TasksClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskInner; +import com.azure.resourcemanager.containerregistry.generated.models.Task; +import com.azure.resourcemanager.containerregistry.generated.models.Tasks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TasksImpl implements Tasks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TasksImpl.class); + + private final TasksClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public TasksImpl( + TasksClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new TaskImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new TaskImpl(inner1, this.manager())); + } + + public Task get(String resourceGroupName, String registryName, String taskName) { + TaskInner inner = this.serviceClient().get(resourceGroupName, registryName, taskName); + if (inner != null) { + return new TaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String taskName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, taskName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String taskName) { + this.serviceClient().delete(resourceGroupName, registryName, taskName); + } + + public void delete(String resourceGroupName, String registryName, String taskName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, taskName, context); + } + + public Task getDetails(String resourceGroupName, String registryName, String taskName) { + TaskInner inner = this.serviceClient().getDetails(resourceGroupName, registryName, taskName); + if (inner != null) { + return new TaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDetailsWithResponse( + String resourceGroupName, String registryName, String taskName, Context context) { + Response inner = + this.serviceClient().getDetailsWithResponse(resourceGroupName, registryName, taskName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Task getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String taskName = Utils.getValueFromIdByName(id, "tasks"); + if (taskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, taskName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String taskName = Utils.getValueFromIdByName(id, "tasks"); + if (taskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, taskName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String taskName = Utils.getValueFromIdByName(id, "tasks"); + if (taskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + this.delete(resourceGroupName, registryName, taskName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String taskName = Utils.getValueFromIdByName(id, "tasks"); + if (taskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + this.delete(resourceGroupName, registryName, taskName, context); + } + + private TasksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public TaskImpl define(String name) { + return new TaskImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokenImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokenImpl.java new file mode 100644 index 0000000000000..b67133ff000df --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokenImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Token; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import com.azure.resourcemanager.containerregistry.generated.models.TokenUpdateParameters; +import java.time.OffsetDateTime; + +public final class TokenImpl implements Token, Token.Definition, Token.Update { + private TokenInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String scopeMapId() { + return this.innerModel().scopeMapId(); + } + + public TokenCredentialsProperties credentials() { + return this.innerModel().credentials(); + } + + public TokenStatus status() { + return this.innerModel().status(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public TokenInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String tokenName; + + private TokenUpdateParameters updateTokenUpdateParameters; + + public TokenImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public Token create() { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .create(resourceGroupName, registryName, tokenName, this.innerModel(), Context.NONE); + return this; + } + + public Token create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .create(resourceGroupName, registryName, tokenName, this.innerModel(), context); + return this; + } + + TokenImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new TokenInner(); + this.serviceManager = serviceManager; + this.tokenName = name; + } + + public TokenImpl update() { + this.updateTokenUpdateParameters = new TokenUpdateParameters(); + return this; + } + + public Token apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .update(resourceGroupName, registryName, tokenName, updateTokenUpdateParameters, Context.NONE); + return this; + } + + public Token apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .update(resourceGroupName, registryName, tokenName, updateTokenUpdateParameters, context); + return this; + } + + TokenImpl( + TokenInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.tokenName = Utils.getValueFromIdByName(innerObject.id(), "tokens"); + } + + public Token refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .getWithResponse(resourceGroupName, registryName, tokenName, Context.NONE) + .getValue(); + return this; + } + + public Token refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .getWithResponse(resourceGroupName, registryName, tokenName, context) + .getValue(); + return this; + } + + public TokenImpl withScopeMapId(String scopeMapId) { + if (isInCreateMode()) { + this.innerModel().withScopeMapId(scopeMapId); + return this; + } else { + this.updateTokenUpdateParameters.withScopeMapId(scopeMapId); + return this; + } + } + + public TokenImpl withCredentials(TokenCredentialsProperties credentials) { + if (isInCreateMode()) { + this.innerModel().withCredentials(credentials); + return this; + } else { + this.updateTokenUpdateParameters.withCredentials(credentials); + return this; + } + } + + public TokenImpl withStatus(TokenStatus status) { + if (isInCreateMode()) { + this.innerModel().withStatus(status); + return this; + } else { + this.updateTokenUpdateParameters.withStatus(status); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensClientImpl.java new file mode 100644 index 0000000000000..8d6f8c25268d1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensClientImpl.java @@ -0,0 +1,1434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.TokensClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import com.azure.resourcemanager.containerregistry.generated.models.TokenListResult; +import com.azure.resourcemanager.containerregistry.generated.models.TokenUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TokensClient. */ +public final class TokensClientImpl implements TokensClient { + private final ClientLogger logger = new ClientLogger(TokensClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TokensService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of TokensClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TokensClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = RestProxy.create(TokensService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientTokens to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface TokensService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tokens/{tokenName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("tokenName") String tokenName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tokens/{tokenName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("tokenName") String tokenName, + @BodyParam("application/json") TokenInner tokenCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tokens/{tokenName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("tokenName") String tokenName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tokens/{tokenName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("tokenName") String tokenName, + @BodyParam("application/json") TokenUpdateParameters tokenUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tokens") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String tokenName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String tokenName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + accept, + context); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String tokenName) { + return getWithResponseAsync(resourceGroupName, registryName, tokenName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInner get(String resourceGroupName, String registryName, String tokenName) { + return getAsync(resourceGroupName, registryName, tokenName).block(); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String tokenName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, tokenName, context).block(); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + if (tokenCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter tokenCreateParameters is required and cannot be null.")); + } else { + tokenCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + tokenCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + if (tokenCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter tokenCreateParameters is required and cannot be null.")); + } else { + tokenCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + tokenCreateParameters, + accept, + context); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TokenInner> beginCreateAsync( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TokenInner.class, TokenInner.class, Context.NONE); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TokenInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TokenInner.class, TokenInner.class, context); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TokenInner> beginCreate( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).getSyncPoller(); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TokenInner> beginCreate( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInner create( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return createAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).block(); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInner create( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, context).block(); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String tokenName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String tokenName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + context); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String tokenName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, tokenName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String tokenName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, tokenName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String tokenName) { + return beginDeleteAsync(resourceGroupName, registryName, tokenName).getSyncPoller(); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String tokenName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, tokenName, context).getSyncPoller(); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String tokenName) { + return beginDeleteAsync(resourceGroupName, registryName, tokenName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String tokenName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, tokenName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String tokenName) { + deleteAsync(resourceGroupName, registryName, tokenName).block(); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String tokenName, Context context) { + deleteAsync(resourceGroupName, registryName, tokenName, context).block(); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + if (tokenUpdateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter tokenUpdateParameters is required and cannot be null.")); + } else { + tokenUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + tokenUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + if (tokenUpdateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter tokenUpdateParameters is required and cannot be null.")); + } else { + tokenUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + tokenUpdateParameters, + accept, + context); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TokenInner> beginUpdateAsync( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TokenInner.class, TokenInner.class, Context.NONE); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TokenInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TokenInner.class, TokenInner.class, context); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TokenInner> beginUpdate( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).getSyncPoller(); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TokenInner> beginUpdate( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInner update( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return updateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).block(); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInner update( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, context).block(); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensImpl.java new file mode 100644 index 0000000000000..48f37ca538fea --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.TokensClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import com.azure.resourcemanager.containerregistry.generated.models.Token; +import com.azure.resourcemanager.containerregistry.generated.models.Tokens; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TokensImpl implements Tokens { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TokensImpl.class); + + private final TokensClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public TokensImpl( + TokensClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Token get(String resourceGroupName, String registryName, String tokenName) { + TokenInner inner = this.serviceClient().get(resourceGroupName, registryName, tokenName); + if (inner != null) { + return new TokenImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String tokenName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, tokenName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TokenImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String tokenName) { + this.serviceClient().delete(resourceGroupName, registryName, tokenName); + } + + public void delete(String resourceGroupName, String registryName, String tokenName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, tokenName, context); + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new TokenImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new TokenImpl(inner1, this.manager())); + } + + public Token getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String tokenName = Utils.getValueFromIdByName(id, "tokens"); + if (tokenName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tokens'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, tokenName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String tokenName = Utils.getValueFromIdByName(id, "tokens"); + if (tokenName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tokens'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, tokenName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String tokenName = Utils.getValueFromIdByName(id, "tokens"); + if (tokenName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tokens'.", id))); + } + this.delete(resourceGroupName, registryName, tokenName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String tokenName = Utils.getValueFromIdByName(id, "tokens"); + if (tokenName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tokens'.", id))); + } + this.delete(resourceGroupName, registryName, tokenName, context); + } + + private TokensClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public TokenImpl define(String name) { + return new TokenImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/Utils.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/Utils.java new file mode 100644 index 0000000000000..c6ca9fbaaaf19 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhookImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhookImpl.java new file mode 100644 index 0000000000000..cab50134f6b9e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhookImpl.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import com.azure.resourcemanager.containerregistry.generated.models.CallbackConfig; +import com.azure.resourcemanager.containerregistry.generated.models.Event; +import com.azure.resourcemanager.containerregistry.generated.models.EventInfo; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Webhook; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookCreateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookUpdateParameters; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class WebhookImpl implements Webhook, Webhook.Definition, Webhook.Update { + private WebhookInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public WebhookStatus status() { + return this.innerModel().status(); + } + + public String scope() { + return this.innerModel().scope(); + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public WebhookInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String webhookName; + + private WebhookCreateParameters createWebhookCreateParameters; + + private WebhookUpdateParameters updateWebhookUpdateParameters; + + public WebhookImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public Webhook create() { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .create(resourceGroupName, registryName, webhookName, createWebhookCreateParameters, Context.NONE); + return this; + } + + public Webhook create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .create(resourceGroupName, registryName, webhookName, createWebhookCreateParameters, context); + return this; + } + + WebhookImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new WebhookInner(); + this.serviceManager = serviceManager; + this.webhookName = name; + this.createWebhookCreateParameters = new WebhookCreateParameters(); + } + + public WebhookImpl update() { + this.updateWebhookUpdateParameters = new WebhookUpdateParameters(); + return this; + } + + public Webhook apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .update(resourceGroupName, registryName, webhookName, updateWebhookUpdateParameters, Context.NONE); + return this; + } + + public Webhook apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .update(resourceGroupName, registryName, webhookName, updateWebhookUpdateParameters, context); + return this; + } + + WebhookImpl( + WebhookInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.webhookName = Utils.getValueFromIdByName(innerObject.id(), "webhooks"); + } + + public Webhook refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .getWithResponse(resourceGroupName, registryName, webhookName, Context.NONE) + .getValue(); + return this; + } + + public Webhook refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .getWithResponse(resourceGroupName, registryName, webhookName, context) + .getValue(); + return this; + } + + public EventInfo ping() { + return serviceManager.webhooks().ping(resourceGroupName, registryName, webhookName); + } + + public Response pingWithResponse(Context context) { + return serviceManager.webhooks().pingWithResponse(resourceGroupName, registryName, webhookName, context); + } + + public CallbackConfig getCallbackConfig() { + return serviceManager.webhooks().getCallbackConfig(resourceGroupName, registryName, webhookName); + } + + public Response getCallbackConfigWithResponse(Context context) { + return serviceManager + .webhooks() + .getCallbackConfigWithResponse(resourceGroupName, registryName, webhookName, context); + } + + public PagedIterable listEvents() { + return serviceManager.webhooks().listEvents(resourceGroupName, registryName, webhookName); + } + + public PagedIterable listEvents(Context context) { + return serviceManager.webhooks().listEvents(resourceGroupName, registryName, webhookName, context); + } + + public WebhookImpl withRegion(Region location) { + this.createWebhookCreateParameters.withLocation(location.toString()); + return this; + } + + public WebhookImpl withRegion(String location) { + this.createWebhookCreateParameters.withLocation(location); + return this; + } + + public WebhookImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withTags(tags); + return this; + } else { + this.updateWebhookUpdateParameters.withTags(tags); + return this; + } + } + + public WebhookImpl withServiceUri(String serviceUri) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withServiceUri(serviceUri); + return this; + } else { + this.updateWebhookUpdateParameters.withServiceUri(serviceUri); + return this; + } + } + + public WebhookImpl withCustomHeaders(Map customHeaders) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withCustomHeaders(customHeaders); + return this; + } else { + this.updateWebhookUpdateParameters.withCustomHeaders(customHeaders); + return this; + } + } + + public WebhookImpl withStatus(WebhookStatus status) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withStatus(status); + return this; + } else { + this.updateWebhookUpdateParameters.withStatus(status); + return this; + } + } + + public WebhookImpl withScope(String scope) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withScope(scope); + return this; + } else { + this.updateWebhookUpdateParameters.withScope(scope); + return this; + } + } + + public WebhookImpl withActions(List actions) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withActions(actions); + return this; + } else { + this.updateWebhookUpdateParameters.withActions(actions); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksClientImpl.java new file mode 100644 index 0000000000000..f42967e712768 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksClientImpl.java @@ -0,0 +1,2128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.WebhooksClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import com.azure.resourcemanager.containerregistry.generated.models.EventListResult; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookCreateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookListResult; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WebhooksClient. */ +public final class WebhooksClientImpl implements WebhooksClient { + private final ClientLogger logger = new ClientLogger(WebhooksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WebhooksService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of WebhooksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebhooksClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = RestProxy.create(WebhooksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientWebhooks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface WebhooksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @BodyParam("application/json") WebhookCreateParameters webhookCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @BodyParam("application/json") WebhookUpdateParameters webhookUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}/ping") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> ping( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCallbackConfig( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}/listEvents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listEvents( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listEventsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String webhookName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String webhookName) { + return getWithResponseAsync(resourceGroupName, registryName, webhookName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebhookInner get(String resourceGroupName, String registryName, String webhookName) { + return getAsync(resourceGroupName, registryName, webhookName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + if (webhookCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null.")); + } else { + webhookCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + webhookCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + if (webhookCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null.")); + } else { + webhookCreateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + webhookCreateParameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WebhookInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WebhookInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WebhookInner> beginCreate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WebhookInner> beginCreate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebhookInner create( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + return createAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebhookInner create( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String webhookName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String webhookName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, webhookName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, webhookName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String webhookName) { + return beginDeleteAsync(resourceGroupName, registryName, webhookName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String webhookName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, webhookName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String webhookName) { + return beginDeleteAsync(resourceGroupName, registryName, webhookName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String webhookName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, webhookName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String webhookName) { + deleteAsync(resourceGroupName, registryName, webhookName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String webhookName, Context context) { + deleteAsync(resourceGroupName, registryName, webhookName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + if (webhookUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null.")); + } else { + webhookUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + webhookUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + if (webhookUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null.")); + } else { + webhookUpdateParameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + webhookUpdateParameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WebhookInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WebhookInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WebhookInner> beginUpdate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WebhookInner> beginUpdate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebhookInner update( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + return updateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebhookInner update( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pingWithResponseAsync( + String resourceGroupName, String registryName, String webhookName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .ping( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pingWithResponseAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .ping( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pingAsync(String resourceGroupName, String registryName, String webhookName) { + return pingWithResponseAsync(resourceGroupName, registryName, webhookName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventInfoInner ping(String resourceGroupName, String registryName, String webhookName) { + return pingAsync(resourceGroupName, registryName, webhookName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + return pingWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCallbackConfigWithResponseAsync( + String resourceGroupName, String registryName, String webhookName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getCallbackConfig( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCallbackConfigWithResponseAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getCallbackConfig( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCallbackConfigAsync( + String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithResponseAsync(resourceGroupName, registryName, webhookName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigAsync(resourceGroupName, registryName, webhookName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCallbackConfigWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + return getCallbackConfigWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEventsSinglePageAsync( + String resourceGroupName, String registryName, String webhookName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listEvents( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEventsSinglePageAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listEvents( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listEventsAsync(String resourceGroupName, String registryName, String webhookName) { + return new PagedFlux<>( + () -> listEventsSinglePageAsync(resourceGroupName, registryName, webhookName), + nextLink -> listEventsNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listEventsAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + return new PagedFlux<>( + () -> listEventsSinglePageAsync(resourceGroupName, registryName, webhookName, context), + nextLink -> listEventsNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName) { + return new PagedIterable<>(listEventsAsync(resourceGroupName, registryName, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listEvents( + String resourceGroupName, String registryName, String webhookName, Context context) { + return new PagedIterable<>(listEventsAsync(resourceGroupName, registryName, webhookName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEventsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listEventsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEventsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listEventsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksImpl.java new file mode 100644 index 0000000000000..40f2a7ab79bbc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksImpl.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.WebhooksClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import com.azure.resourcemanager.containerregistry.generated.models.CallbackConfig; +import com.azure.resourcemanager.containerregistry.generated.models.Event; +import com.azure.resourcemanager.containerregistry.generated.models.EventInfo; +import com.azure.resourcemanager.containerregistry.generated.models.Webhook; +import com.azure.resourcemanager.containerregistry.generated.models.Webhooks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WebhooksImpl implements Webhooks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebhooksImpl.class); + + private final WebhooksClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public WebhooksImpl( + WebhooksClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Webhook get(String resourceGroupName, String registryName, String webhookName) { + WebhookInner inner = this.serviceClient().get(resourceGroupName, registryName, webhookName); + if (inner != null) { + return new WebhookImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, webhookName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WebhookImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String webhookName) { + this.serviceClient().delete(resourceGroupName, registryName, webhookName); + } + + public void delete(String resourceGroupName, String registryName, String webhookName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, webhookName, context); + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new WebhookImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new WebhookImpl(inner1, this.manager())); + } + + public EventInfo ping(String resourceGroupName, String registryName, String webhookName) { + EventInfoInner inner = this.serviceClient().ping(resourceGroupName, registryName, webhookName); + if (inner != null) { + return new EventInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + Response inner = + this.serviceClient().pingWithResponse(resourceGroupName, registryName, webhookName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EventInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CallbackConfig getCallbackConfig(String resourceGroupName, String registryName, String webhookName) { + CallbackConfigInner inner = + this.serviceClient().getCallbackConfig(resourceGroupName, registryName, webhookName); + if (inner != null) { + return new CallbackConfigImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getCallbackConfigWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + Response inner = + this.serviceClient().getCallbackConfigWithResponse(resourceGroupName, registryName, webhookName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CallbackConfigImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName) { + PagedIterable inner = this.serviceClient().listEvents(resourceGroupName, registryName, webhookName); + return Utils.mapPage(inner, inner1 -> new EventImpl(inner1, this.manager())); + } + + public PagedIterable listEvents( + String resourceGroupName, String registryName, String webhookName, Context context) { + PagedIterable inner = + this.serviceClient().listEvents(resourceGroupName, registryName, webhookName, context); + return Utils.mapPage(inner, inner1 -> new EventImpl(inner1, this.manager())); + } + + public Webhook getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String webhookName = Utils.getValueFromIdByName(id, "webhooks"); + if (webhookName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webhooks'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, webhookName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String webhookName = Utils.getValueFromIdByName(id, "webhooks"); + if (webhookName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webhooks'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, webhookName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String webhookName = Utils.getValueFromIdByName(id, "webhooks"); + if (webhookName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webhooks'.", id))); + } + this.delete(resourceGroupName, registryName, webhookName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String webhookName = Utils.getValueFromIdByName(id, "webhooks"); + if (webhookName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webhooks'.", id))); + } + this.delete(resourceGroupName, registryName, webhookName, context); + } + + private WebhooksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public WebhookImpl define(String name) { + return new WebhookImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/package-info.java new file mode 100644 index 0000000000000..07abd9fff5346 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for ContainerRegistryManagementClient. null. */ +package com.azure.resourcemanager.containerregistry.generated.implementation; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Action.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Action.java new file mode 100644 index 0000000000000..13e8cdabd0653 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Action.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Action. */ +public final class Action extends ExpandableStringEnum { + /** Static value Allow for Action. */ + public static final Action ALLOW = fromString("Allow"); + + /** + * Creates or finds a Action from its string representation. + * + * @param name a name to look for. + * @return the corresponding Action. + */ + @JsonCreator + public static Action fromString(String name) { + return fromString(name, Action.class); + } + + /** @return known Action values. */ + public static Collection values() { + return values(Action.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActionsRequired.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActionsRequired.java new file mode 100644 index 0000000000000..2130a9eccbd56 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActionsRequired.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionsRequired. */ +public final class ActionsRequired extends ExpandableStringEnum { + /** Static value None for ActionsRequired. */ + public static final ActionsRequired NONE = fromString("None"); + + /** Static value Recreate for ActionsRequired. */ + public static final ActionsRequired RECREATE = fromString("Recreate"); + + /** + * Creates or finds a ActionsRequired from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionsRequired. + */ + @JsonCreator + public static ActionsRequired fromString(String name) { + return fromString(name, ActionsRequired.class); + } + + /** @return known ActionsRequired values. */ + public static Collection values() { + return values(ActionsRequired.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationProperties.java new file mode 100644 index 0000000000000..cb8c41d126be9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The activation properties of the connected registry. */ +@Immutable +public final class ActivationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivationProperties.class); + + /* + * The activation status of the connected registry. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ActivationStatus status; + + /** + * Get the status property: The activation status of the connected registry. + * + * @return the status value. + */ + public ActivationStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationStatus.java new file mode 100644 index 0000000000000..0b2b15f919136 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActivationStatus. */ +public final class ActivationStatus extends ExpandableStringEnum { + /** Static value Active for ActivationStatus. */ + public static final ActivationStatus ACTIVE = fromString("Active"); + + /** Static value Inactive for ActivationStatus. */ + public static final ActivationStatus INACTIVE = fromString("Inactive"); + + /** + * Creates or finds a ActivationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActivationStatus. + */ + @JsonCreator + public static ActivationStatus fromString(String name) { + return fromString(name, ActivationStatus.class); + } + + /** @return known ActivationStatus values. */ + public static Collection values() { + return values(ActivationStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Actor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Actor.java new file mode 100644 index 0000000000000..8ec7a08968a6f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Actor.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@Fluent +public final class Actor { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Actor.class); + + /* + * The subject or username associated with the request context that + * generated the event. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: 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 name property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPool.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPool.java new file mode 100644 index 0000000000000..26b7b32d69050 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPool.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolInner; +import java.util.Map; + +/** An immutable client-side representation of AgentPool. */ +public interface AgentPool { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the count property: The count of agent machine. + * + * @return the count value. + */ + Integer count(); + + /** + * Gets the tier property: The Tier of agent machine. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the os property: The OS of agent machine. + * + * @return the os value. + */ + OS os(); + + /** + * Gets the virtualNetworkSubnetResourceId property: The Virtual Network Subnet Resource Id of the agent machine. + * + * @return the virtualNetworkSubnetResourceId value. + */ + String virtualNetworkSubnetResourceId(); + + /** + * Gets the provisioningState property: The provisioning state of this agent pool. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolInner object. + * + * @return the inner object. + */ + AgentPoolInner innerModel(); + + /** The entirety of the AgentPool definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The AgentPool definition stages. */ + interface DefinitionStages { + /** The first stage of the AgentPool definition. */ + interface Blank extends WithLocation { + } + /** The stage of the AgentPool definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the AgentPool definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the AgentPool definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithCount, + DefinitionStages.WithTier, + DefinitionStages.WithOs, + DefinitionStages.WithVirtualNetworkSubnetResourceId { + /** + * Executes the create request. + * + * @return the created resource. + */ + AgentPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AgentPool create(Context context); + } + /** The stage of the AgentPool definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the AgentPool definition allowing to specify count. */ + interface WithCount { + /** + * Specifies the count property: The count of agent machine. + * + * @param count The count of agent machine. + * @return the next definition stage. + */ + WithCreate withCount(Integer count); + } + /** The stage of the AgentPool definition allowing to specify tier. */ + interface WithTier { + /** + * Specifies the tier property: The Tier of agent machine. + * + * @param tier The Tier of agent machine. + * @return the next definition stage. + */ + WithCreate withTier(String tier); + } + /** The stage of the AgentPool definition allowing to specify os. */ + interface WithOs { + /** + * Specifies the os property: The OS of agent machine. + * + * @param os The OS of agent machine. + * @return the next definition stage. + */ + WithCreate withOs(OS os); + } + /** The stage of the AgentPool definition allowing to specify virtualNetworkSubnetResourceId. */ + interface WithVirtualNetworkSubnetResourceId { + /** + * Specifies the virtualNetworkSubnetResourceId property: The Virtual Network Subnet Resource Id of the + * agent machine. + * + * @param virtualNetworkSubnetResourceId The Virtual Network Subnet Resource Id of the agent machine. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkSubnetResourceId(String virtualNetworkSubnetResourceId); + } + } + /** + * Begins update for the AgentPool resource. + * + * @return the stage of resource update. + */ + AgentPool.Update update(); + + /** The template for AgentPool update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithCount { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AgentPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AgentPool apply(Context context); + } + /** The AgentPool update stages. */ + interface UpdateStages { + /** The stage of the AgentPool update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The ARM resource tags.. + * + * @param tags The ARM resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the AgentPool update allowing to specify count. */ + interface WithCount { + /** + * Specifies the count property: The count of agent machine. + * + * @param count The count of agent machine. + * @return the next definition stage. + */ + Update withCount(Integer count); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AgentPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AgentPool refresh(Context context); + + /** + * Gets the count of queued runs for a given agent pool. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + AgentPoolQueueStatus getQueueStatus(); + + /** + * Gets the count of queued runs for a given agent pool. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + Response getQueueStatusWithResponse(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolListResult.java new file mode 100644 index 0000000000000..732a22a9220f7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The collection of agent pools. */ +@Fluent +public final class AgentPoolListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolListResult.class); + + /* + * The collection value. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next set of paged results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The collection value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection value. + * + * @param value the value value to set. + * @return the AgentPoolListResult object itself. + */ + public AgentPoolListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next set of paged results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next set of paged results. + * + * @param nextLink the nextLink value to set. + * @return the AgentPoolListResult object itself. + */ + public AgentPoolListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolQueueStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolQueueStatus.java new file mode 100644 index 0000000000000..aa89af79b8b75 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolQueueStatus.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolQueueStatusInner; + +/** An immutable client-side representation of AgentPoolQueueStatus. */ +public interface AgentPoolQueueStatus { + /** + * Gets the count property: The number of pending runs in the queue. + * + * @return the count value. + */ + Integer count(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.AgentPoolQueueStatusInner + * object. + * + * @return the inner object. + */ + AgentPoolQueueStatusInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolUpdateParameters.java new file mode 100644 index 0000000000000..00b1af2051b60 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolUpdateParameters.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating an agent pool. */ +@JsonFlatten +@Fluent +public class AgentPoolUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolUpdateParameters.class); + + /* + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The count of agent machine + */ + @JsonProperty(value = "properties.count") + private Integer count; + + /** + * Get the tags property: The ARM resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The ARM resource tags. + * + * @param tags the tags value to set. + * @return the AgentPoolUpdateParameters object itself. + */ + public AgentPoolUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the count property: The count of agent machine. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: The count of agent machine. + * + * @param count the count value to set. + * @return the AgentPoolUpdateParameters object itself. + */ + public AgentPoolUpdateParameters withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPools.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPools.java new file mode 100644 index 0000000000000..474e0bdb0c6de --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPools.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AgentPools. */ +public interface AgentPools { + /** + * Gets the detailed information for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + AgentPool get(String resourceGroupName, String registryName, String agentPoolName); + + /** + * Gets the detailed information for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String agentPoolName, Context context); + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String agentPoolName); + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String agentPoolName, Context context); + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the count of queued runs for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + AgentPoolQueueStatus getQueueStatus(String resourceGroupName, String registryName, String agentPoolName); + + /** + * Gets the count of queued runs for a given agent pool. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the count of queued runs for a given agent pool. + */ + Response getQueueStatusWithResponse( + String resourceGroupName, String registryName, String agentPoolName, Context context); + + /** + * Gets the detailed information for a given agent pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + AgentPool getById(String id); + + /** + * Gets the detailed information for a given agent pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given agent pool. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a specified agent pool resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a specified agent pool resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AgentPool resource. + * + * @param name resource name. + * @return the first stage of the new AgentPool definition. + */ + AgentPool.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentProperties.java new file mode 100644 index 0000000000000..970469b38d39a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that determine the run agent configuration. */ +@Fluent +public final class AgentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentProperties.class); + + /* + * The CPU configuration in terms of number of cores required for the run. + */ + @JsonProperty(value = "cpu") + private Integer cpu; + + /** + * Get the cpu property: The CPU configuration in terms of number of cores required for the run. + * + * @return the cpu value. + */ + public Integer cpu() { + return this.cpu; + } + + /** + * Set the cpu property: The CPU configuration in terms of number of cores required for the run. + * + * @param cpu the cpu value to set. + * @return the AgentProperties object itself. + */ + public AgentProperties withCpu(Integer cpu) { + this.cpu = cpu; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Architecture.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Architecture.java new file mode 100644 index 0000000000000..96d3a89d45abb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Architecture.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Architecture. */ +public final class Architecture extends ExpandableStringEnum { + /** Static value amd64 for Architecture. */ + public static final Architecture AMD64 = fromString("amd64"); + + /** Static value x86 for Architecture. */ + public static final Architecture X86 = fromString("x86"); + + /** Static value 386 for Architecture. */ + public static final Architecture THREE_EIGHT_SIX = fromString("386"); + + /** Static value arm for Architecture. */ + public static final Architecture ARM = fromString("arm"); + + /** Static value arm64 for Architecture. */ + public static final Architecture ARM64 = fromString("arm64"); + + /** + * Creates or finds a Architecture from its string representation. + * + * @param name a name to look for. + * @return the corresponding Architecture. + */ + @JsonCreator + public static Architecture fromString(String name) { + return fromString(name, Architecture.class); + } + + /** @return known Architecture values. */ + public static Collection values() { + return values(Architecture.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Argument.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Argument.java new file mode 100644 index 0000000000000..9dc1fb92b9bda --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Argument.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a run argument. */ +@Fluent +public final class Argument { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Argument.class); + + /* + * The name of the argument. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The value of the argument. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /* + * Flag to indicate whether the argument represents a secret and want to be + * removed from build logs. + */ + @JsonProperty(value = "isSecret") + private Boolean isSecret; + + /** + * Get the name property: The name of the argument. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the argument. + * + * @param name the name value to set. + * @return the Argument object itself. + */ + public Argument withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value of the argument. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the argument. + * + * @param value the value value to set. + * @return the Argument object itself. + */ + public Argument withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the isSecret property: 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 the isSecret property: Flag to indicate whether the argument represents a secret and want to be removed from + * build logs. + * + * @param isSecret the isSecret value to set. + * @return the Argument object itself. + */ + public Argument withIsSecret(Boolean isSecret) { + this.isSecret = isSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Argument")); + } + if (value() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property value in model Argument")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuditLogStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuditLogStatus.java new file mode 100644 index 0000000000000..a16c1788e727a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuditLogStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuditLogStatus. */ +public final class AuditLogStatus extends ExpandableStringEnum { + /** Static value Enabled for AuditLogStatus. */ + public static final AuditLogStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for AuditLogStatus. */ + public static final AuditLogStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a AuditLogStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuditLogStatus. + */ + @JsonCreator + public static AuditLogStatus fromString(String name) { + return fromString(name, AuditLogStatus.class); + } + + /** @return known AuditLogStatus values. */ + public static Collection values() { + return values(AuditLogStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthInfo.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthInfo.java new file mode 100644 index 0000000000000..b817a33199d83 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthInfo.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The authorization properties for accessing the source code repository. */ +@Fluent +public final class AuthInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthInfo.class); + + /* + * The type of Auth token. + */ + @JsonProperty(value = "tokenType", required = true) + private TokenType tokenType; + + /* + * The access token used to access the source control provider. + */ + @JsonProperty(value = "token", required = true) + private String token; + + /* + * The refresh token used to refresh the access token. + */ + @JsonProperty(value = "refreshToken") + private String refreshToken; + + /* + * The scope of the access token. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * Time in seconds that the token remains valid + */ + @JsonProperty(value = "expiresIn") + private Integer expiresIn; + + /** + * Get the tokenType property: The type of Auth token. + * + * @return the tokenType value. + */ + public TokenType tokenType() { + return this.tokenType; + } + + /** + * Set the tokenType property: The type of Auth token. + * + * @param tokenType the tokenType value to set. + * @return the AuthInfo object itself. + */ + public AuthInfo withTokenType(TokenType tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get the token property: The access token used to access the source control provider. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Set the token property: The access token used to access the source control provider. + * + * @param token the token value to set. + * @return the AuthInfo object itself. + */ + public AuthInfo withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the refreshToken property: The refresh token used to refresh the access token. + * + * @return the refreshToken value. + */ + public String refreshToken() { + return this.refreshToken; + } + + /** + * Set the refreshToken property: The refresh token used to refresh the access token. + * + * @param refreshToken the refreshToken value to set. + * @return the AuthInfo object itself. + */ + public AuthInfo withRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get the scope property: The scope of the access token. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The scope of the access token. + * + * @param scope the scope value to set. + * @return the AuthInfo object itself. + */ + public AuthInfo withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the expiresIn property: Time in seconds that the token remains valid. + * + * @return the expiresIn value. + */ + public Integer expiresIn() { + return this.expiresIn; + } + + /** + * Set the expiresIn property: Time in seconds that the token remains valid. + * + * @param expiresIn the expiresIn value to set. + * @return the AuthInfo object itself. + */ + public AuthInfo withExpiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tokenType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property tokenType in model AuthInfo")); + } + if (token() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property token in model AuthInfo")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthInfoUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthInfoUpdateParameters.java new file mode 100644 index 0000000000000..c9763617d146b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthInfoUpdateParameters.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The authorization properties for accessing the source code repository. */ +@Fluent +public final class AuthInfoUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthInfoUpdateParameters.class); + + /* + * The type of Auth token. + */ + @JsonProperty(value = "tokenType") + private TokenType tokenType; + + /* + * The access token used to access the source control provider. + */ + @JsonProperty(value = "token") + private String token; + + /* + * The refresh token used to refresh the access token. + */ + @JsonProperty(value = "refreshToken") + private String refreshToken; + + /* + * The scope of the access token. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * Time in seconds that the token remains valid + */ + @JsonProperty(value = "expiresIn") + private Integer expiresIn; + + /** + * Get the tokenType property: The type of Auth token. + * + * @return the tokenType value. + */ + public TokenType tokenType() { + return this.tokenType; + } + + /** + * Set the tokenType property: The type of Auth token. + * + * @param tokenType the tokenType value to set. + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withTokenType(TokenType tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get the token property: The access token used to access the source control provider. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Set the token property: The access token used to access the source control provider. + * + * @param token the token value to set. + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the refreshToken property: The refresh token used to refresh the access token. + * + * @return the refreshToken value. + */ + public String refreshToken() { + return this.refreshToken; + } + + /** + * Set the refreshToken property: The refresh token used to refresh the access token. + * + * @param refreshToken the refreshToken value to set. + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get the scope property: The scope of the access token. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The scope of the access token. + * + * @param scope the scope value to set. + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the expiresIn property: Time in seconds that the token remains valid. + * + * @return the expiresIn value. + */ + public Integer expiresIn() { + return this.expiresIn; + } + + /** + * Set the expiresIn property: Time in seconds that the token remains valid. + * + * @param expiresIn the expiresIn value to set. + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withExpiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageDependency.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageDependency.java new file mode 100644 index 0000000000000..4a4432bd9b3c4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageDependency.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties that describe a base image dependency. */ +@Fluent +public final class BaseImageDependency { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BaseImageDependency.class); + + /* + * The type of the base image dependency. + */ + @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 property: The type of the base image dependency. + * + * @return the type value. + */ + public BaseImageDependencyType type() { + return this.type; + } + + /** + * Set the type property: The type of the base image dependency. + * + * @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 property: The registry login server. + * + * @return the registry value. + */ + public String registry() { + return this.registry; + } + + /** + * Set the registry property: 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 property: The repository name. + * + * @return the repository value. + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository property: 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 property: The tag name. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: 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 digest property: The sha256-based digest of the image manifest. + * + * @return the digest value. + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageDependencyType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageDependencyType.java new file mode 100644 index 0000000000000..77c57ad93e654 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageDependencyType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BaseImageDependencyType. */ +public final class BaseImageDependencyType extends ExpandableStringEnum { + /** Static value BuildTime for BaseImageDependencyType. */ + public static final BaseImageDependencyType BUILD_TIME = fromString("BuildTime"); + + /** Static value RunTime for BaseImageDependencyType. */ + public static final BaseImageDependencyType RUN_TIME = fromString("RunTime"); + + /** + * Creates or finds a BaseImageDependencyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BaseImageDependencyType. + */ + @JsonCreator + public static BaseImageDependencyType fromString(String name) { + return fromString(name, BaseImageDependencyType.class); + } + + /** @return known BaseImageDependencyType values. */ + public static Collection values() { + return values(BaseImageDependencyType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTrigger.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTrigger.java new file mode 100644 index 0000000000000..4476511b6abcb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTrigger.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The trigger based on base image dependency. */ +@Fluent +public final class BaseImageTrigger { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BaseImageTrigger.class); + + /* + * The type of the auto trigger for base image dependency updates. + */ + @JsonProperty(value = "baseImageTriggerType", required = true) + private BaseImageTriggerType baseImageTriggerType; + + /* + * The endpoint URL for receiving update triggers. + */ + @JsonProperty(value = "updateTriggerEndpoint") + private String updateTriggerEndpoint; + + /* + * Type of Payload body for Base image update triggers. + */ + @JsonProperty(value = "updateTriggerPayloadType") + private UpdateTriggerPayloadType updateTriggerPayloadType; + + /* + * The current status of trigger. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /* + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the baseImageTriggerType property: The type of the auto trigger for base image dependency updates. + * + * @return the baseImageTriggerType value. + */ + public BaseImageTriggerType baseImageTriggerType() { + return this.baseImageTriggerType; + } + + /** + * Set the baseImageTriggerType property: The type of the auto trigger for base image dependency updates. + * + * @param baseImageTriggerType the baseImageTriggerType value to set. + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withBaseImageTriggerType(BaseImageTriggerType baseImageTriggerType) { + this.baseImageTriggerType = baseImageTriggerType; + return this; + } + + /** + * Get the updateTriggerEndpoint property: The endpoint URL for receiving update triggers. + * + * @return the updateTriggerEndpoint value. + */ + public String updateTriggerEndpoint() { + return this.updateTriggerEndpoint; + } + + /** + * Set the updateTriggerEndpoint property: The endpoint URL for receiving update triggers. + * + * @param updateTriggerEndpoint the updateTriggerEndpoint value to set. + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withUpdateTriggerEndpoint(String updateTriggerEndpoint) { + this.updateTriggerEndpoint = updateTriggerEndpoint; + return this; + } + + /** + * Get the updateTriggerPayloadType property: Type of Payload body for Base image update triggers. + * + * @return the updateTriggerPayloadType value. + */ + public UpdateTriggerPayloadType updateTriggerPayloadType() { + return this.updateTriggerPayloadType; + } + + /** + * Set the updateTriggerPayloadType property: Type of Payload body for Base image update triggers. + * + * @param updateTriggerPayloadType the updateTriggerPayloadType value to set. + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withUpdateTriggerPayloadType(UpdateTriggerPayloadType updateTriggerPayloadType) { + this.updateTriggerPayloadType = updateTriggerPayloadType; + return this; + } + + /** + * Get the status property: The current status of trigger. + * + * @return the status value. + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of trigger. + * + * @param status the status value to set. + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name property: The name of the trigger. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the trigger. + * + * @param name the name value to set. + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (baseImageTriggerType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property baseImageTriggerType in model BaseImageTrigger")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model BaseImageTrigger")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTriggerType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTriggerType.java new file mode 100644 index 0000000000000..41a35707ea1dc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTriggerType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BaseImageTriggerType. */ +public final class BaseImageTriggerType extends ExpandableStringEnum { + /** Static value All for BaseImageTriggerType. */ + public static final BaseImageTriggerType ALL = fromString("All"); + + /** Static value Runtime for BaseImageTriggerType. */ + public static final BaseImageTriggerType RUNTIME = fromString("Runtime"); + + /** + * Creates or finds a BaseImageTriggerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BaseImageTriggerType. + */ + @JsonCreator + public static BaseImageTriggerType fromString(String name) { + return fromString(name, BaseImageTriggerType.class); + } + + /** @return known BaseImageTriggerType values. */ + public static Collection values() { + return values(BaseImageTriggerType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTriggerUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTriggerUpdateParameters.java new file mode 100644 index 0000000000000..20964c59deda0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTriggerUpdateParameters.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties for updating base image dependency trigger. */ +@Fluent +public final class BaseImageTriggerUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BaseImageTriggerUpdateParameters.class); + + /* + * The type of the auto trigger for base image dependency updates. + */ + @JsonProperty(value = "baseImageTriggerType") + private BaseImageTriggerType baseImageTriggerType; + + /* + * The endpoint URL for receiving update triggers. + */ + @JsonProperty(value = "updateTriggerEndpoint") + private String updateTriggerEndpoint; + + /* + * Type of Payload body for Base image update triggers. + */ + @JsonProperty(value = "updateTriggerPayloadType") + private UpdateTriggerPayloadType updateTriggerPayloadType; + + /* + * The current status of trigger. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /* + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the baseImageTriggerType property: The type of the auto trigger for base image dependency updates. + * + * @return the baseImageTriggerType value. + */ + public BaseImageTriggerType baseImageTriggerType() { + return this.baseImageTriggerType; + } + + /** + * Set the baseImageTriggerType property: The type of the auto trigger for base image dependency updates. + * + * @param baseImageTriggerType the baseImageTriggerType value to set. + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withBaseImageTriggerType(BaseImageTriggerType baseImageTriggerType) { + this.baseImageTriggerType = baseImageTriggerType; + return this; + } + + /** + * Get the updateTriggerEndpoint property: The endpoint URL for receiving update triggers. + * + * @return the updateTriggerEndpoint value. + */ + public String updateTriggerEndpoint() { + return this.updateTriggerEndpoint; + } + + /** + * Set the updateTriggerEndpoint property: The endpoint URL for receiving update triggers. + * + * @param updateTriggerEndpoint the updateTriggerEndpoint value to set. + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withUpdateTriggerEndpoint(String updateTriggerEndpoint) { + this.updateTriggerEndpoint = updateTriggerEndpoint; + return this; + } + + /** + * Get the updateTriggerPayloadType property: Type of Payload body for Base image update triggers. + * + * @return the updateTriggerPayloadType value. + */ + public UpdateTriggerPayloadType updateTriggerPayloadType() { + return this.updateTriggerPayloadType; + } + + /** + * Set the updateTriggerPayloadType property: Type of Payload body for Base image update triggers. + * + * @param updateTriggerPayloadType the updateTriggerPayloadType value to set. + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withUpdateTriggerPayloadType( + UpdateTriggerPayloadType updateTriggerPayloadType) { + this.updateTriggerPayloadType = updateTriggerPayloadType; + return this; + } + + /** + * Get the status property: The current status of trigger. + * + * @return the status value. + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of trigger. + * + * @param status the status value to set. + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name property: The name of the trigger. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the trigger. + * + * @param name the name value to set. + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model BaseImageTriggerUpdateParameters")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CallbackConfig.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CallbackConfig.java new file mode 100644 index 0000000000000..adfb179e32896 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CallbackConfig.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner; +import java.util.Map; + +/** An immutable client-side representation of CallbackConfig. */ +public interface CallbackConfig { + /** + * Gets the serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + String serviceUri(); + + /** + * Gets the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value. + */ + Map customHeaders(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner object. + * + * @return the inner object. + */ + CallbackConfigInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CertificateType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CertificateType.java new file mode 100644 index 0000000000000..a3c3206862508 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CertificateType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CertificateType. */ +public final class CertificateType extends ExpandableStringEnum { + /** Static value LocalDirectory for CertificateType. */ + public static final CertificateType LOCAL_DIRECTORY = fromString("LocalDirectory"); + + /** + * Creates or finds a CertificateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateType. + */ + @JsonCreator + public static CertificateType fromString(String name) { + return fromString(name, CertificateType.class); + } + + /** @return known CertificateType values. */ + public static Collection values() { + return values(CertificateType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistries.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistries.java new file mode 100644 index 0000000000000..dd4bb77f4bac8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistries.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ConnectedRegistries. */ +public interface ConnectedRegistries { + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + ConnectedRegistry get(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deletes a connected registry 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 connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Lists all connected registries 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all connected registries 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 filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry. + */ + PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deactivate(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deactivate(String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Gets the properties of the connected registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + ConnectedRegistry getById(String id); + + /** + * Gets the properties of the connected registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a connected registry from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a connected registry from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ConnectedRegistry resource. + * + * @param name resource name. + * @return the first stage of the new ConnectedRegistry definition. + */ + ConnectedRegistry.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistry.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistry.java new file mode 100644 index 0000000000000..7b70d018e1097 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistry.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of ConnectedRegistry. */ +public interface ConnectedRegistry { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the mode property: The mode of the connected registry resource that indicates the permissions of the + * registry. + * + * @return the mode value. + */ + ConnectedRegistryMode mode(); + + /** + * Gets the version property: The current version of ACR runtime on the connected registry. + * + * @return the version value. + */ + String version(); + + /** + * Gets the connectionState property: The current connection state of the connected registry. + * + * @return the connectionState value. + */ + ConnectionState connectionState(); + + /** + * Gets the lastActivityTime property: The last activity time of the connected registry. + * + * @return the lastActivityTime value. + */ + OffsetDateTime lastActivityTime(); + + /** + * Gets the activation property: The activation properties of the connected registry. + * + * @return the activation value. + */ + ActivationProperties activation(); + + /** + * Gets the parent property: The parent of the connected registry. + * + * @return the parent value. + */ + ParentProperties parent(); + + /** + * Gets the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @return the clientTokenIds value. + */ + List clientTokenIds(); + + /** + * Gets the loginServer property: The login server properties of the connected registry. + * + * @return the loginServer value. + */ + LoginServerProperties loginServer(); + + /** + * Gets the logging property: The logging properties of the connected registry. + * + * @return the logging value. + */ + LoggingProperties logging(); + + /** + * Gets the statusDetails property: The list of current statuses of the connected registry. + * + * @return the statusDetails value. + */ + List statusDetails(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner object. + * + * @return the inner object. + */ + ConnectedRegistryInner innerModel(); + + /** The entirety of the ConnectedRegistry definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ConnectedRegistry definition stages. */ + interface DefinitionStages { + /** The first stage of the ConnectedRegistry definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ConnectedRegistry definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the ConnectedRegistry definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithMode, + DefinitionStages.WithParent, + DefinitionStages.WithClientTokenIds, + DefinitionStages.WithLoginServer, + DefinitionStages.WithLogging { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConnectedRegistry create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConnectedRegistry create(Context context); + } + /** The stage of the ConnectedRegistry definition allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The mode of the connected registry resource that indicates the permissions + * of the registry.. + * + * @param mode The mode of the connected registry resource that indicates the permissions of the registry. + * @return the next definition stage. + */ + WithCreate withMode(ConnectedRegistryMode mode); + } + /** The stage of the ConnectedRegistry definition allowing to specify parent. */ + interface WithParent { + /** + * Specifies the parent property: The parent of the connected registry.. + * + * @param parent The parent of the connected registry. + * @return the next definition stage. + */ + WithCreate withParent(ParentProperties parent); + } + /** The stage of the ConnectedRegistry definition allowing to specify clientTokenIds. */ + interface WithClientTokenIds { + /** + * Specifies the clientTokenIds property: The list of the ACR token resource IDs used to authenticate + * clients to the connected registry.. + * + * @param clientTokenIds The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * @return the next definition stage. + */ + WithCreate withClientTokenIds(List clientTokenIds); + } + /** The stage of the ConnectedRegistry definition allowing to specify loginServer. */ + interface WithLoginServer { + /** + * Specifies the loginServer property: The login server properties of the connected registry.. + * + * @param loginServer The login server properties of the connected registry. + * @return the next definition stage. + */ + WithCreate withLoginServer(LoginServerProperties loginServer); + } + /** The stage of the ConnectedRegistry definition allowing to specify logging. */ + interface WithLogging { + /** + * Specifies the logging property: The logging properties of the connected registry.. + * + * @param logging The logging properties of the connected registry. + * @return the next definition stage. + */ + WithCreate withLogging(LoggingProperties logging); + } + } + /** + * Begins update for the ConnectedRegistry resource. + * + * @return the stage of resource update. + */ + ConnectedRegistry.Update update(); + + /** The template for ConnectedRegistry update. */ + interface Update + extends UpdateStages.WithSyncProperties, UpdateStages.WithLogging, UpdateStages.WithClientTokenIds { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConnectedRegistry apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConnectedRegistry apply(Context context); + } + /** The ConnectedRegistry update stages. */ + interface UpdateStages { + /** The stage of the ConnectedRegistry update allowing to specify syncProperties. */ + interface WithSyncProperties { + /** + * Specifies the syncProperties property: The sync properties of the connected registry with its parent.. + * + * @param syncProperties The sync properties of the connected registry with its parent. + * @return the next definition stage. + */ + Update withSyncProperties(SyncUpdateProperties syncProperties); + } + /** The stage of the ConnectedRegistry update allowing to specify logging. */ + interface WithLogging { + /** + * Specifies the logging property: The logging properties of the connected registry.. + * + * @param logging The logging properties of the connected registry. + * @return the next definition stage. + */ + Update withLogging(LoggingProperties logging); + } + /** The stage of the ConnectedRegistry update allowing to specify clientTokenIds. */ + interface WithClientTokenIds { + /** + * Specifies the clientTokenIds property: The list of the ACR token resource IDs used to authenticate + * clients to the connected registry.. + * + * @param clientTokenIds The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * @return the next definition stage. + */ + Update withClientTokenIds(List clientTokenIds); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConnectedRegistry refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConnectedRegistry refresh(Context context); + + /** + * Deactivates the connected registry instance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deactivate(); + + /** + * Deactivates the connected registry instance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deactivate(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryListResult.java new file mode 100644 index 0000000000000..73e2eec86b32a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list connected registries for a container registry. */ +@Fluent +public final class ConnectedRegistryListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedRegistryListResult.class); + + /* + * The list of connected registries. Since this list may be incomplete, the + * nextLink field should be used to request the next list of connected + * registries. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of connected + * registries. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of connected registries. Since this list may be incomplete, the nextLink field + * should be used to request the next list of connected registries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of connected registries. Since this list may be incomplete, the nextLink field + * should be used to request the next list of connected registries. + * + * @param value the value value to set. + * @return the ConnectedRegistryListResult object itself. + */ + public ConnectedRegistryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of connected registries. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of connected registries. + * + * @param nextLink the nextLink value to set. + * @return the ConnectedRegistryListResult object itself. + */ + public ConnectedRegistryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryMode.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryMode.java new file mode 100644 index 0000000000000..a842771bd8761 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectedRegistryMode. */ +public final class ConnectedRegistryMode extends ExpandableStringEnum { + /** Static value Registry for ConnectedRegistryMode. */ + public static final ConnectedRegistryMode REGISTRY = fromString("Registry"); + + /** Static value Mirror for ConnectedRegistryMode. */ + public static final ConnectedRegistryMode MIRROR = fromString("Mirror"); + + /** + * Creates or finds a ConnectedRegistryMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectedRegistryMode. + */ + @JsonCreator + public static ConnectedRegistryMode fromString(String name) { + return fromString(name, ConnectedRegistryMode.class); + } + + /** @return known ConnectedRegistryMode values. */ + public static Collection values() { + return values(ConnectedRegistryMode.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryUpdateParameters.java new file mode 100644 index 0000000000000..af27b84ab9992 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryUpdateParameters.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The parameters for updating a connected registry. */ +@JsonFlatten +@Fluent +public class ConnectedRegistryUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedRegistryUpdateParameters.class); + + /* + * The sync properties of the connected registry with its parent. + */ + @JsonProperty(value = "properties.syncProperties") + private SyncUpdateProperties syncProperties; + + /* + * The logging properties of the connected registry. + */ + @JsonProperty(value = "properties.logging") + private LoggingProperties logging; + + /* + * The list of the ACR token resource IDs used to authenticate clients to + * the connected registry. + */ + @JsonProperty(value = "properties.clientTokenIds") + private List clientTokenIds; + + /** + * Get the syncProperties property: The sync properties of the connected registry with its parent. + * + * @return the syncProperties value. + */ + public SyncUpdateProperties syncProperties() { + return this.syncProperties; + } + + /** + * Set the syncProperties property: The sync properties of the connected registry with its parent. + * + * @param syncProperties the syncProperties value to set. + * @return the ConnectedRegistryUpdateParameters object itself. + */ + public ConnectedRegistryUpdateParameters withSyncProperties(SyncUpdateProperties syncProperties) { + this.syncProperties = syncProperties; + return this; + } + + /** + * Get the logging property: The logging properties of the connected registry. + * + * @return the logging value. + */ + public LoggingProperties logging() { + return this.logging; + } + + /** + * Set the logging property: The logging properties of the connected registry. + * + * @param logging the logging value to set. + * @return the ConnectedRegistryUpdateParameters object itself. + */ + public ConnectedRegistryUpdateParameters withLogging(LoggingProperties logging) { + this.logging = logging; + return this; + } + + /** + * Get the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @return the clientTokenIds value. + */ + public List clientTokenIds() { + return this.clientTokenIds; + } + + /** + * Set the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @param clientTokenIds the clientTokenIds value to set. + * @return the ConnectedRegistryUpdateParameters object itself. + */ + public ConnectedRegistryUpdateParameters withClientTokenIds(List clientTokenIds) { + this.clientTokenIds = clientTokenIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (syncProperties() != null) { + syncProperties().validate(); + } + if (logging() != null) { + logging().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionState.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionState.java new file mode 100644 index 0000000000000..770d94f478772 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionState. */ +public final class ConnectionState extends ExpandableStringEnum { + /** Static value Online for ConnectionState. */ + public static final ConnectionState ONLINE = fromString("Online"); + + /** Static value Offline for ConnectionState. */ + public static final ConnectionState OFFLINE = fromString("Offline"); + + /** Static value Syncing for ConnectionState. */ + public static final ConnectionState SYNCING = fromString("Syncing"); + + /** Static value Unhealthy for ConnectionState. */ + public static final ConnectionState UNHEALTHY = fromString("Unhealthy"); + + /** + * Creates or finds a ConnectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionState. + */ + @JsonCreator + public static ConnectionState fromString(String name) { + return fromString(name, ConnectionState.class); + } + + /** @return known ConnectionState values. */ + public static Collection values() { + return values(ConnectionState.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionStatus.java new file mode 100644 index 0000000000000..dda6853de59f2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionStatus. */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** Static value Approved for ConnectionStatus. */ + public static final ConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Pending for ConnectionStatus. */ + public static final ConnectionStatus PENDING = fromString("Pending"); + + /** Static value Rejected for ConnectionStatus. */ + public static final ConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for ConnectionStatus. */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a ConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionStatus. + */ + @JsonCreator + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** @return known ConnectionStatus values. */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Credentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Credentials.java new file mode 100644 index 0000000000000..056fe092f52ec --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Credentials.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters that describes a set of credentials that will be used when a run is invoked. */ +@Fluent +public final class Credentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Credentials.class); + + /* + * Describes the credential parameters for accessing the source registry. + */ + @JsonProperty(value = "sourceRegistry") + private SourceRegistryCredentials sourceRegistry; + + /* + * Describes the credential parameters for accessing other custom + * registries. The key + * for the dictionary item will be the registry login server + * (myregistry.azurecr.io) and + * the value of the item will be the registry credentials for accessing the + * registry. + */ + @JsonProperty(value = "customRegistries") + private Map customRegistries; + + /** + * Get the sourceRegistry property: Describes the credential parameters for accessing the source registry. + * + * @return the sourceRegistry value. + */ + public SourceRegistryCredentials sourceRegistry() { + return this.sourceRegistry; + } + + /** + * Set the sourceRegistry property: Describes the credential parameters for accessing the source registry. + * + * @param sourceRegistry the sourceRegistry value to set. + * @return the Credentials object itself. + */ + public Credentials withSourceRegistry(SourceRegistryCredentials sourceRegistry) { + this.sourceRegistry = sourceRegistry; + return this; + } + + /** + * Get the customRegistries property: Describes the credential parameters for accessing other custom registries. The + * key for the dictionary item will be the registry login server (myregistry.azurecr.io) and the value of the item + * will be the registry credentials for accessing the registry. + * + * @return the customRegistries value. + */ + public Map customRegistries() { + return this.customRegistries; + } + + /** + * Set the customRegistries property: Describes the credential parameters for accessing other custom registries. The + * key for the dictionary item will be the registry login server (myregistry.azurecr.io) and the value of the item + * will be the registry credentials for accessing the registry. + * + * @param customRegistries the customRegistries value to set. + * @return the Credentials object itself. + */ + public Credentials withCustomRegistries(Map customRegistries) { + this.customRegistries = customRegistries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceRegistry() != null) { + sourceRegistry().validate(); + } + if (customRegistries() != null) { + customRegistries() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CustomRegistryCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CustomRegistryCredentials.java new file mode 100644 index 0000000000000..33353732a372a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CustomRegistryCredentials.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the credentials that will be used to access a custom registry during a run. */ +@Fluent +public final class CustomRegistryCredentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRegistryCredentials.class); + + /* + * The username for logging into the custom registry. + */ + @JsonProperty(value = "userName") + private SecretObject username; + + /* + * The password for logging into the custom registry. The password is a + * secret + * object that allows multiple ways of providing the value for it. + */ + @JsonProperty(value = "password") + private SecretObject password; + + /* + * Indicates the managed identity assigned to the custom credential. If a + * user-assigned identity + * this value is the Client ID. If a system-assigned identity, the value + * will be `system`. In + * the case of a system-assigned identity, the Client ID will be determined + * by the runner. This + * identity may be used to authenticate to key vault to retrieve + * credentials or it may be the only + * source of authentication used for accessing the registry. + */ + @JsonProperty(value = "identity") + private String identity; + + /** + * Get the username property: The username for logging into the custom registry. + * + * @return the username value. + */ + public SecretObject username() { + return this.username; + } + + /** + * Set the username property: The username for logging into the custom registry. + * + * @param username the username value to set. + * @return the CustomRegistryCredentials object itself. + */ + public CustomRegistryCredentials withUsername(SecretObject username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password for logging into the custom registry. The password is a secret object + * that allows multiple ways of providing the value for it. + * + * @return the password value. + */ + public SecretObject password() { + return this.password; + } + + /** + * Set the password property: The password for logging into the custom registry. The password is a secret object + * that allows multiple ways of providing the value for it. + * + * @param password the password value to set. + * @return the CustomRegistryCredentials object itself. + */ + public CustomRegistryCredentials withPassword(SecretObject password) { + this.password = password; + return this; + } + + /** + * Get the identity property: Indicates the managed identity assigned to the custom credential. If a user-assigned + * identity this value is the Client ID. If a system-assigned identity, the value will be `system`. In the case of a + * system-assigned identity, the Client ID will be determined by the runner. This identity may be used to + * authenticate to key vault to retrieve credentials or it may be the only source of authentication used for + * accessing the registry. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: Indicates the managed identity assigned to the custom credential. If a user-assigned + * identity this value is the Client ID. If a system-assigned identity, the value will be `system`. In the case of a + * system-assigned identity, the Client ID will be determined by the runner. This identity may be used to + * authenticate to key vault to retrieve credentials or it may be the only source of authentication used for + * accessing the registry. + * + * @param identity the identity value to set. + * @return the CustomRegistryCredentials object itself. + */ + public CustomRegistryCredentials withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (username() != null) { + username().validate(); + } + if (password() != null) { + password().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DefaultAction.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DefaultAction.java new file mode 100644 index 0000000000000..02ecaf84c952d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DefaultAction.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DefaultAction. */ +public final class DefaultAction extends ExpandableStringEnum { + /** Static value Allow for DefaultAction. */ + public static final DefaultAction ALLOW = fromString("Allow"); + + /** Static value Deny for DefaultAction. */ + public static final DefaultAction DENY = fromString("Deny"); + + /** + * Creates or finds a DefaultAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultAction. + */ + @JsonCreator + public static DefaultAction fromString(String name) { + return fromString(name, DefaultAction.class); + } + + /** @return known DefaultAction values. */ + public static Collection values() { + return values(DefaultAction.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerBuildRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerBuildRequest.java new file mode 100644 index 0000000000000..e7b908af93f9b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerBuildRequest.java @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The parameters for a docker quick build. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("DockerBuildRequest") +@Fluent +public final class DockerBuildRequest extends RunRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DockerBuildRequest.class); + + /* + * The fully qualified image names including the repository and tag. + */ + @JsonProperty(value = "imageNames") + private List imageNames; + + /* + * The value of this property indicates whether the image built should be + * pushed to the registry or not. + */ + @JsonProperty(value = "isPushEnabled") + private Boolean isPushEnabled; + + /* + * The value of this property indicates whether the image cache is enabled + * or not. + */ + @JsonProperty(value = "noCache") + private Boolean noCache; + + /* + * The Docker file path relative to the source location. + */ + @JsonProperty(value = "dockerFilePath", required = true) + private String dockerFilePath; + + /* + * The name of the target build stage for the docker build. + */ + @JsonProperty(value = "target") + private String target; + + /* + * The collection of override arguments to be used when executing the run. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /* + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /* + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform", required = true) + private PlatformProperties platform; + + /* + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /* + * The URL(absolute or relative) of the source context. It can be an URL to + * a tar or git repository. + * If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + */ + @JsonProperty(value = "sourceLocation") + private String sourceLocation; + + /* + * The properties that describes a set of credentials that will be used + * when this run is invoked. + */ + @JsonProperty(value = "credentials") + private Credentials credentials; + + /** + * Get the imageNames property: The fully qualified image names including the repository and tag. + * + * @return the imageNames value. + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the imageNames property: The fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the isPushEnabled property: 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 isPushEnabled property: The value of this property indicates whether the image built should be pushed to + * the registry or not. + * + * @param isPushEnabled the isPushEnabled value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the noCache property: 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 noCache property: The value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the dockerFilePath property: The Docker file path relative to the source location. + * + * @return the dockerFilePath value. + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the dockerFilePath property: The Docker file path relative to the source location. + * + * @param dockerFilePath the dockerFilePath value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the target property: The name of the target build stage for the docker build. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The name of the target build stage for the docker build. + * + * @param target the target value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the arguments property: The collection of override arguments to be used when executing the run. + * + * @return the arguments value. + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the arguments property: The collection of override arguments to be used when executing the run. + * + * @param arguments the arguments value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the timeout property: Run timeout in seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: Run timeout in seconds. + * + * @param timeout the timeout value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the platform property: The platform properties against which the run has to happen. + * + * @return the platform value. + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform property: The platform properties against which the run has to happen. + * + * @param platform the platform value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the agentConfiguration property: The machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar + * or git repository. If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + * + * @return the sourceLocation value. + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar + * or git repository. If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + * + * @param sourceLocation the sourceLocation value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + /** + * Get the credentials property: The properties that describes a set of credentials that will be used when this run + * is invoked. + * + * @return the credentials value. + */ + public Credentials credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The properties that describes a set of credentials that will be used when this run + * is invoked. + * + * @param credentials the credentials value to set. + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withCredentials(Credentials credentials) { + this.credentials = credentials; + return this; + } + + /** {@inheritDoc} */ + @Override + public DockerBuildRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { + super.withIsArchiveEnabled(isArchiveEnabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public DockerBuildRequest withAgentPoolName(String agentPoolName) { + super.withAgentPoolName(agentPoolName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DockerBuildRequest withLogTemplate(String logTemplate) { + super.withLogTemplate(logTemplate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dockerFilePath() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dockerFilePath in model DockerBuildRequest")); + } + if (arguments() != null) { + arguments().forEach(e -> e.validate()); + } + if (platform() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property platform in model DockerBuildRequest")); + } else { + platform().validate(); + } + if (agentConfiguration() != null) { + agentConfiguration().validate(); + } + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerBuildStepUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerBuildStepUpdateParameters.java new file mode 100644 index 0000000000000..ee8528bff69f7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerBuildStepUpdateParameters.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties for updating a docker build step. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Docker") +@Fluent +public final class DockerBuildStepUpdateParameters extends TaskStepUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DockerBuildStepUpdateParameters.class); + + /* + * The fully qualified image names including the repository and tag. + */ + @JsonProperty(value = "imageNames") + private List imageNames; + + /* + * The value of this property indicates whether the image built should be + * pushed to the registry or not. + */ + @JsonProperty(value = "isPushEnabled") + private Boolean isPushEnabled; + + /* + * The value of this property indicates whether the image cache is enabled + * or not. + */ + @JsonProperty(value = "noCache") + private Boolean noCache; + + /* + * The Docker file path relative to the source context. + */ + @JsonProperty(value = "dockerFilePath") + private String dockerFilePath; + + /* + * The collection of override arguments to be used when executing this + * build step. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /* + * The name of the target build stage for the docker build. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get the imageNames property: The fully qualified image names including the repository and tag. + * + * @return the imageNames value. + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the imageNames property: 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 isPushEnabled property: 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 isPushEnabled property: 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 noCache property: 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 noCache property: 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 dockerFilePath property: The Docker file path relative to the source context. + * + * @return the dockerFilePath value. + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the dockerFilePath property: The Docker file path relative to the source context. + * + * @param dockerFilePath the dockerFilePath value to set. + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the arguments property: The collection of override arguments to be used when executing this build step. + * + * @return the arguments value. + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the arguments property: The collection of override arguments to be used when executing this build step. + * + * @param arguments the arguments value to set. + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the target property: The name of the target build stage for the docker build. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The name of the target build stage for the docker build. + * + * @param target the target value to set. + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withTarget(String target) { + this.target = target; + return this; + } + + /** {@inheritDoc} */ + @Override + public DockerBuildStepUpdateParameters withContextPath(String contextPath) { + super.withContextPath(contextPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public DockerBuildStepUpdateParameters withContextAccessToken(String contextAccessToken) { + super.withContextAccessToken(contextAccessToken); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (arguments() != null) { + arguments().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerTaskStep.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerTaskStep.java new file mode 100644 index 0000000000000..58c2544aac85d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerTaskStep.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The Docker build step. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Docker") +@Fluent +public final class DockerTaskStep extends TaskStepProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DockerTaskStep.class); + + /* + * The fully qualified image names including the repository and tag. + */ + @JsonProperty(value = "imageNames") + private List imageNames; + + /* + * The value of this property indicates whether the image built should be + * pushed to the registry or not. + */ + @JsonProperty(value = "isPushEnabled") + private Boolean isPushEnabled; + + /* + * The value of this property indicates whether the image cache is enabled + * or not. + */ + @JsonProperty(value = "noCache") + private Boolean noCache; + + /* + * The Docker file path relative to the source context. + */ + @JsonProperty(value = "dockerFilePath", required = true) + private String dockerFilePath; + + /* + * The name of the target build stage for the docker build. + */ + @JsonProperty(value = "target") + private String target; + + /* + * The collection of override arguments to be used when executing this + * build step. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /** + * Get the imageNames property: The fully qualified image names including the repository and tag. + * + * @return the imageNames value. + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the imageNames property: The fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set. + * @return the DockerTaskStep object itself. + */ + public DockerTaskStep withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the isPushEnabled property: 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 isPushEnabled property: 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 DockerTaskStep object itself. + */ + public DockerTaskStep withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the noCache property: 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 noCache property: The value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set. + * @return the DockerTaskStep object itself. + */ + public DockerTaskStep withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the dockerFilePath property: The Docker file path relative to the source context. + * + * @return the dockerFilePath value. + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the dockerFilePath property: The Docker file path relative to the source context. + * + * @param dockerFilePath the dockerFilePath value to set. + * @return the DockerTaskStep object itself. + */ + public DockerTaskStep withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the target property: The name of the target build stage for the docker build. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The name of the target build stage for the docker build. + * + * @param target the target value to set. + * @return the DockerTaskStep object itself. + */ + public DockerTaskStep withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the arguments property: The collection of override arguments to be used when executing this build step. + * + * @return the arguments value. + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the arguments property: The collection of override arguments to be used when executing this build step. + * + * @param arguments the arguments value to set. + * @return the DockerTaskStep object itself. + */ + public DockerTaskStep withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** {@inheritDoc} */ + @Override + public DockerTaskStep withContextPath(String contextPath) { + super.withContextPath(contextPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public DockerTaskStep withContextAccessToken(String contextAccessToken) { + super.withContextAccessToken(contextAccessToken); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dockerFilePath() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property dockerFilePath in model DockerTaskStep")); + } + if (arguments() != null) { + arguments().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskRunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskRunRequest.java new file mode 100644 index 0000000000000..880363314151a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskRunRequest.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The parameters for a quick task run request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("EncodedTaskRunRequest") +@Fluent +public final class EncodedTaskRunRequest extends RunRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncodedTaskRunRequest.class); + + /* + * Base64 encoded value of the template/definition file content. + */ + @JsonProperty(value = "encodedTaskContent", required = true) + private String encodedTaskContent; + + /* + * Base64 encoded value of the parameters/values file content. + */ + @JsonProperty(value = "encodedValuesContent") + private String encodedValuesContent; + + /* + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /* + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /* + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform", required = true) + private PlatformProperties platform; + + /* + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /* + * The URL(absolute or relative) of the source context. It can be an URL to + * a tar or git repository. + * If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + */ + @JsonProperty(value = "sourceLocation") + private String sourceLocation; + + /* + * The properties that describes a set of credentials that will be used + * when this run is invoked. + */ + @JsonProperty(value = "credentials") + private Credentials credentials; + + /** + * Get the encodedTaskContent property: Base64 encoded value of the template/definition file content. + * + * @return the encodedTaskContent value. + */ + public String encodedTaskContent() { + return this.encodedTaskContent; + } + + /** + * Set the encodedTaskContent property: Base64 encoded value of the template/definition file content. + * + * @param encodedTaskContent the encodedTaskContent value to set. + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withEncodedTaskContent(String encodedTaskContent) { + this.encodedTaskContent = encodedTaskContent; + return this; + } + + /** + * Get the encodedValuesContent property: Base64 encoded value of the parameters/values file content. + * + * @return the encodedValuesContent value. + */ + public String encodedValuesContent() { + return this.encodedValuesContent; + } + + /** + * Set the encodedValuesContent property: Base64 encoded value of the parameters/values file content. + * + * @param encodedValuesContent the encodedValuesContent value to set. + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withEncodedValuesContent(String encodedValuesContent) { + this.encodedValuesContent = encodedValuesContent; + return this; + } + + /** + * Get the values property: The collection of overridable values that can be passed when running a task. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The collection of overridable values that can be passed when running a task. + * + * @param values the values value to set. + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withValues(List values) { + this.values = values; + return this; + } + + /** + * Get the timeout property: Run timeout in seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: Run timeout in seconds. + * + * @param timeout the timeout value to set. + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the platform property: The platform properties against which the run has to happen. + * + * @return the platform value. + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform property: The platform properties against which the run has to happen. + * + * @param platform the platform value to set. + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the agentConfiguration property: The machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set. + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar + * or git repository. If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + * + * @return the sourceLocation value. + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar + * or git repository. If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + * + * @param sourceLocation the sourceLocation value to set. + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + /** + * Get the credentials property: The properties that describes a set of credentials that will be used when this run + * is invoked. + * + * @return the credentials value. + */ + public Credentials credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The properties that describes a set of credentials that will be used when this run + * is invoked. + * + * @param credentials the credentials value to set. + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withCredentials(Credentials credentials) { + this.credentials = credentials; + return this; + } + + /** {@inheritDoc} */ + @Override + public EncodedTaskRunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { + super.withIsArchiveEnabled(isArchiveEnabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public EncodedTaskRunRequest withAgentPoolName(String agentPoolName) { + super.withAgentPoolName(agentPoolName); + return this; + } + + /** {@inheritDoc} */ + @Override + public EncodedTaskRunRequest withLogTemplate(String logTemplate) { + super.withLogTemplate(logTemplate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (encodedTaskContent() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property encodedTaskContent in model EncodedTaskRunRequest")); + } + if (values() != null) { + values().forEach(e -> e.validate()); + } + if (platform() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property platform in model EncodedTaskRunRequest")); + } else { + platform().validate(); + } + if (agentConfiguration() != null) { + agentConfiguration().validate(); + } + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskStep.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskStep.java new file mode 100644 index 0000000000000..cab4314530fe2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskStep.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of a encoded task step. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("EncodedTask") +@Fluent +public final class EncodedTaskStep extends TaskStepProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncodedTaskStep.class); + + /* + * Base64 encoded value of the template/definition file content. + */ + @JsonProperty(value = "encodedTaskContent", required = true) + private String encodedTaskContent; + + /* + * Base64 encoded value of the parameters/values file content. + */ + @JsonProperty(value = "encodedValuesContent") + private String encodedValuesContent; + + /* + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the encodedTaskContent property: Base64 encoded value of the template/definition file content. + * + * @return the encodedTaskContent value. + */ + public String encodedTaskContent() { + return this.encodedTaskContent; + } + + /** + * Set the encodedTaskContent property: Base64 encoded value of the template/definition file content. + * + * @param encodedTaskContent the encodedTaskContent value to set. + * @return the EncodedTaskStep object itself. + */ + public EncodedTaskStep withEncodedTaskContent(String encodedTaskContent) { + this.encodedTaskContent = encodedTaskContent; + return this; + } + + /** + * Get the encodedValuesContent property: Base64 encoded value of the parameters/values file content. + * + * @return the encodedValuesContent value. + */ + public String encodedValuesContent() { + return this.encodedValuesContent; + } + + /** + * Set the encodedValuesContent property: Base64 encoded value of the parameters/values file content. + * + * @param encodedValuesContent the encodedValuesContent value to set. + * @return the EncodedTaskStep object itself. + */ + public EncodedTaskStep withEncodedValuesContent(String encodedValuesContent) { + this.encodedValuesContent = encodedValuesContent; + return this; + } + + /** + * Get the values property: The collection of overridable values that can be passed when running a task. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The collection of overridable values that can be passed when running a task. + * + * @param values the values value to set. + * @return the EncodedTaskStep object itself. + */ + public EncodedTaskStep withValues(List values) { + this.values = values; + return this; + } + + /** {@inheritDoc} */ + @Override + public EncodedTaskStep withContextPath(String contextPath) { + super.withContextPath(contextPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public EncodedTaskStep withContextAccessToken(String contextAccessToken) { + super.withContextAccessToken(contextAccessToken); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (encodedTaskContent() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property encodedTaskContent in model EncodedTaskStep")); + } + if (values() != null) { + values().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskStepUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskStepUpdateParameters.java new file mode 100644 index 0000000000000..769f01ce0803a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskStepUpdateParameters.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties for updating encoded task step. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("EncodedTask") +@Fluent +public final class EncodedTaskStepUpdateParameters extends TaskStepUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncodedTaskStepUpdateParameters.class); + + /* + * Base64 encoded value of the template/definition file content. + */ + @JsonProperty(value = "encodedTaskContent") + private String encodedTaskContent; + + /* + * Base64 encoded value of the parameters/values file content. + */ + @JsonProperty(value = "encodedValuesContent") + private String encodedValuesContent; + + /* + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the encodedTaskContent property: Base64 encoded value of the template/definition file content. + * + * @return the encodedTaskContent value. + */ + public String encodedTaskContent() { + return this.encodedTaskContent; + } + + /** + * Set the encodedTaskContent property: Base64 encoded value of the template/definition file content. + * + * @param encodedTaskContent the encodedTaskContent value to set. + * @return the EncodedTaskStepUpdateParameters object itself. + */ + public EncodedTaskStepUpdateParameters withEncodedTaskContent(String encodedTaskContent) { + this.encodedTaskContent = encodedTaskContent; + return this; + } + + /** + * Get the encodedValuesContent property: Base64 encoded value of the parameters/values file content. + * + * @return the encodedValuesContent value. + */ + public String encodedValuesContent() { + return this.encodedValuesContent; + } + + /** + * Set the encodedValuesContent property: Base64 encoded value of the parameters/values file content. + * + * @param encodedValuesContent the encodedValuesContent value to set. + * @return the EncodedTaskStepUpdateParameters object itself. + */ + public EncodedTaskStepUpdateParameters withEncodedValuesContent(String encodedValuesContent) { + this.encodedValuesContent = encodedValuesContent; + return this; + } + + /** + * Get the values property: The collection of overridable values that can be passed when running a task. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The collection of overridable values that can be passed when running a task. + * + * @param values the values value to set. + * @return the EncodedTaskStepUpdateParameters object itself. + */ + public EncodedTaskStepUpdateParameters withValues(List values) { + this.values = values; + return this; + } + + /** {@inheritDoc} */ + @Override + public EncodedTaskStepUpdateParameters withContextPath(String contextPath) { + super.withContextPath(contextPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public EncodedTaskStepUpdateParameters withContextAccessToken(String contextAccessToken) { + super.withContextAccessToken(contextAccessToken); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (values() != null) { + values().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionProperty.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionProperty.java new file mode 100644 index 0000000000000..32cf744300294 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionProperty.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EncryptionProperty model. */ +@Fluent +public final class EncryptionProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionProperty.class); + + /* + * Indicates whether or not the encryption is enabled for container + * registry. + */ + @JsonProperty(value = "status") + private EncryptionStatus status; + + /* + * Key vault properties. + */ + @JsonProperty(value = "keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * Get the status property: Indicates whether or not the encryption is enabled for container registry. + * + * @return the status value. + */ + public EncryptionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether or not the encryption is enabled for container registry. + * + * @param status the status value to set. + * @return the EncryptionProperty object itself. + */ + public EncryptionProperty withStatus(EncryptionStatus status) { + this.status = status; + return this; + } + + /** + * Get the keyVaultProperties property: Key vault properties. + * + * @return the keyVaultProperties value. + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: Key vault properties. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionProperty object itself. + */ + public EncryptionProperty withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionStatus.java new file mode 100644 index 0000000000000..cf463d385e276 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionStatus. */ +public final class EncryptionStatus extends ExpandableStringEnum { + /** Static value enabled for EncryptionStatus. */ + public static final EncryptionStatus ENABLED = fromString("enabled"); + + /** Static value disabled for EncryptionStatus. */ + public static final EncryptionStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a EncryptionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionStatus. + */ + @JsonCreator + public static EncryptionStatus fromString(String name) { + return fromString(name, EncryptionStatus.class); + } + + /** @return known EncryptionStatus values. */ + public static Collection values() { + return values(EncryptionStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Event.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Event.java new file mode 100644 index 0000000000000..69e5ea4ff136c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Event.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; + +/** An immutable client-side representation of Event. */ +public interface Event { + /** + * Gets the id property: The event ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the eventRequestMessage property: The event request message sent to the service URI. + * + * @return the eventRequestMessage value. + */ + EventRequestMessage eventRequestMessage(); + + /** + * Gets the eventResponseMessage property: The event response message received from the service URI. + * + * @return the eventResponseMessage value. + */ + EventResponseMessage eventResponseMessage(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner object. + * + * @return the inner object. + */ + EventInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventContent.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventContent.java new file mode 100644 index 0000000000000..dc1d251102378 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventContent.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The content of the event request message. */ +@Fluent +public final class EventContent { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventContent.class); + + /* + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The time at which the event occurred. + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime 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 id property: The event ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: 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 timestamp property: The time at which the event occurred. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The time at which the event occurred. + * + * @param timestamp the timestamp value to set. + * @return the EventContent object itself. + */ + public EventContent withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the action property: The action that encompasses the provided event. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: 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 property: The target of the event. + * + * @return the target value. + */ + public Target target() { + return this.target; + } + + /** + * Set the target property: 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 property: The request that generated the event. + * + * @return the request value. + */ + public Request request() { + return this.request; + } + + /** + * Set the request property: 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 actor property: 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 actor property: 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 source property: 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 source property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() != null) { + target().validate(); + } + if (request() != null) { + request().validate(); + } + if (actor() != null) { + actor().validate(); + } + if (source() != null) { + source().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventInfo.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventInfo.java new file mode 100644 index 0000000000000..82217118396b7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventInfo.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner; + +/** An immutable client-side representation of EventInfo. */ +public interface EventInfo { + /** + * Gets the id property: The event ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner object. + * + * @return the inner object. + */ + EventInfoInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventListResult.java new file mode 100644 index 0000000000000..c156971f9bd6b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list events for a webhook. */ +@Fluent +public final class EventListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventListResult.class); + + /* + * The list of events. Since this list may be incomplete, the nextLink + * field should be used to request the next list of events. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of events. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of events. Since this list may be incomplete, the nextLink field should be used + * to request the next list of events. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of events. Since this list may be incomplete, the nextLink field should be used + * to request the next list of events. + * + * @param value the value value to set. + * @return the EventListResult object itself. + */ + public EventListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of events. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of events. + * + * @param nextLink the nextLink value to set. + * @return the EventListResult object itself. + */ + public EventListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventRequestMessage.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventRequestMessage.java new file mode 100644 index 0000000000000..fee97a4df744b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventRequestMessage.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The event request message sent to the service URI. */ +@Fluent +public final class EventRequestMessage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventRequestMessage.class); + + /* + * 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 property: The content of the event request message. + * + * @return the content value. + */ + public EventContent content() { + return this.content; + } + + /** + * Set the content property: 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 property: The headers of the event request message. + * + * @return the headers value. + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers property: 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 method property: The HTTP method used to send the event request message. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: 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 requestUri property: The URI used to send the event request message. + * + * @return the requestUri value. + */ + public String requestUri() { + return this.requestUri; + } + + /** + * Set the requestUri property: 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 version property: The HTTP message version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (content() != null) { + content().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventResponseMessage.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventResponseMessage.java new file mode 100644 index 0000000000000..27288da0dc30c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventResponseMessage.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The event response message received from the service URI. */ +@Fluent +public final class EventResponseMessage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventResponseMessage.class); + + /* + * 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 property: The content of the event response message. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: 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 property: The headers of the event response message. + * + * @return the headers value. + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers property: 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 reasonPhrase property: The reason phrase of the event response message. + * + * @return the reasonPhrase value. + */ + public String reasonPhrase() { + return this.reasonPhrase; + } + + /** + * Set the reasonPhrase property: 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 statusCode property: The status code of the event response message. + * + * @return the statusCode value. + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode property: 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 version property: The HTTP message version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipeline.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipeline.java new file mode 100644 index 0000000000000..80fe8d1dc53a9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipeline.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +import java.util.List; + +/** An immutable client-side representation of ExportPipeline. */ +public interface ExportPipeline { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the export pipeline. + * + * @return the location value. + */ + String location(); + + /** + * Gets the identity property: The identity of the export pipeline. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the target property: The target properties of the export pipeline. + * + * @return the target value. + */ + ExportPipelineTargetProperties target(); + + /** + * Gets the options property: The list of all options configured for the pipeline. + * + * @return the options value. + */ + List options(); + + /** + * Gets the provisioningState property: The provisioning state of the pipeline at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner object. + * + * @return the inner object. + */ + ExportPipelineInner innerModel(); + + /** The entirety of the ExportPipeline definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExportPipeline definition stages. */ + interface DefinitionStages { + /** The first stage of the ExportPipeline definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExportPipeline definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the ExportPipeline definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithIdentity, + DefinitionStages.WithTarget, + DefinitionStages.WithOptions { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExportPipeline create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExportPipeline create(Context context); + } + /** The stage of the ExportPipeline definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the export pipeline. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the export pipeline. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the ExportPipeline definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the export pipeline.. + * + * @param identity The identity of the export pipeline. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + /** The stage of the ExportPipeline definition allowing to specify target. */ + interface WithTarget { + /** + * Specifies the target property: The target properties of the export pipeline.. + * + * @param target The target properties of the export pipeline. + * @return the next definition stage. + */ + WithCreate withTarget(ExportPipelineTargetProperties target); + } + /** The stage of the ExportPipeline definition allowing to specify options. */ + interface WithOptions { + /** + * Specifies the options property: The list of all options configured for the pipeline.. + * + * @param options The list of all options configured for the pipeline. + * @return the next definition stage. + */ + WithCreate withOptions(List options); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExportPipeline refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExportPipeline refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineListResult.java new file mode 100644 index 0000000000000..f47e9dad6b1fa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list export pipelines for a container registry. */ +@Fluent +public final class ExportPipelineListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportPipelineListResult.class); + + /* + * The list of export pipelines. Since this list may be incomplete, the + * nextLink field should be used to request the next list of export + * pipelines. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of pipeline runs. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of export pipelines. Since this list may be incomplete, the nextLink field + * should be used to request the next list of export pipelines. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of export pipelines. Since this list may be incomplete, the nextLink field + * should be used to request the next list of export pipelines. + * + * @param value the value value to set. + * @return the ExportPipelineListResult object itself. + */ + public ExportPipelineListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @param nextLink the nextLink value to set. + * @return the ExportPipelineListResult object itself. + */ + public ExportPipelineListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineTargetProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineTargetProperties.java new file mode 100644 index 0000000000000..6cbc3a38aa0d0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineTargetProperties.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the export pipeline target. */ +@Fluent +public final class ExportPipelineTargetProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportPipelineTargetProperties.class); + + /* + * The type of target for the export pipeline. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The target uri of the export pipeline. + * When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" + * When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName" + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * They key vault secret uri to obtain the target storage SAS token. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String keyVaultUri; + + /** + * Get the type property: The type of target for the export pipeline. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of target for the export pipeline. + * + * @param type the type value to set. + * @return the ExportPipelineTargetProperties object itself. + */ + public ExportPipelineTargetProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the uri property: The target uri of the export pipeline. When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName". + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The target uri of the export pipeline. When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName". + * + * @param uri the uri value to set. + * @return the ExportPipelineTargetProperties object itself. + */ + public ExportPipelineTargetProperties withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the keyVaultUri property: They key vault secret uri to obtain the target storage SAS token. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: They key vault secret uri to obtain the target storage SAS token. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the ExportPipelineTargetProperties object itself. + */ + public ExportPipelineTargetProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultUri in model ExportPipelineTargetProperties")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelines.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelines.java new file mode 100644 index 0000000000000..58cbea608d361 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelines.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExportPipelines. */ +public interface ExportPipelines { + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + ExportPipeline get(String resourceGroupName, String registryName, String exportPipelineName); + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String exportPipelineName); + + /** + * Deletes an export pipeline 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 exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Lists all export pipelines 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all export pipelines 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the export pipeline. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + ExportPipeline getById(String id); + + /** + * Gets the properties of the export pipeline. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an export pipeline from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an export pipeline from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ExportPipeline resource. + * + * @param name resource name. + * @return the first stage of the new ExportPipeline definition. + */ + ExportPipeline.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicy.java new file mode 100644 index 0000000000000..17e48387d1871 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicy.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The export policy for a container registry. */ +@Fluent +public final class ExportPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportPolicy.class); + + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private ExportPolicyStatus status; + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public ExportPolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The value that indicates whether the policy is enabled or not. + * + * @param status the status value to set. + * @return the ExportPolicy object itself. + */ + public ExportPolicy withStatus(ExportPolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicyStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicyStatus.java new file mode 100644 index 0000000000000..e02f9b19322dc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicyStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExportPolicyStatus. */ +public final class ExportPolicyStatus extends ExpandableStringEnum { + /** Static value enabled for ExportPolicyStatus. */ + public static final ExportPolicyStatus ENABLED = fromString("enabled"); + + /** Static value disabled for ExportPolicyStatus. */ + public static final ExportPolicyStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a ExportPolicyStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExportPolicyStatus. + */ + @JsonCreator + public static ExportPolicyStatus fromString(String name) { + return fromString(name, ExportPolicyStatus.class); + } + + /** @return known ExportPolicyStatus values. */ + public static Collection values() { + return values(ExportPolicyStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskRunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskRunRequest.java new file mode 100644 index 0000000000000..389d0ad621167 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskRunRequest.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The request parameters for a scheduling run against a task file. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("FileTaskRunRequest") +@Fluent +public final class FileTaskRunRequest extends RunRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileTaskRunRequest.class); + + /* + * The template/definition file path relative to the source. + */ + @JsonProperty(value = "taskFilePath", required = true) + private String taskFilePath; + + /* + * The values/parameters file path relative to the source. + */ + @JsonProperty(value = "valuesFilePath") + private String valuesFilePath; + + /* + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /* + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /* + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform", required = true) + private PlatformProperties platform; + + /* + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /* + * The URL(absolute or relative) of the source context. It can be an URL to + * a tar or git repository. + * If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + */ + @JsonProperty(value = "sourceLocation") + private String sourceLocation; + + /* + * The properties that describes a set of credentials that will be used + * when this run is invoked. + */ + @JsonProperty(value = "credentials") + private Credentials credentials; + + /** + * Get the taskFilePath property: The template/definition file path relative to the source. + * + * @return the taskFilePath value. + */ + public String taskFilePath() { + return this.taskFilePath; + } + + /** + * Set the taskFilePath property: The template/definition file path relative to the source. + * + * @param taskFilePath the taskFilePath value to set. + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withTaskFilePath(String taskFilePath) { + this.taskFilePath = taskFilePath; + return this; + } + + /** + * Get the valuesFilePath property: The values/parameters file path relative to the source. + * + * @return the valuesFilePath value. + */ + public String valuesFilePath() { + return this.valuesFilePath; + } + + /** + * Set the valuesFilePath property: The values/parameters file path relative to the source. + * + * @param valuesFilePath the valuesFilePath value to set. + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withValuesFilePath(String valuesFilePath) { + this.valuesFilePath = valuesFilePath; + return this; + } + + /** + * Get the values property: The collection of overridable values that can be passed when running a task. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The collection of overridable values that can be passed when running a task. + * + * @param values the values value to set. + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withValues(List values) { + this.values = values; + return this; + } + + /** + * Get the timeout property: Run timeout in seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: Run timeout in seconds. + * + * @param timeout the timeout value to set. + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the platform property: The platform properties against which the run has to happen. + * + * @return the platform value. + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform property: The platform properties against which the run has to happen. + * + * @param platform the platform value to set. + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the agentConfiguration property: The machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set. + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar + * or git repository. If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + * + * @return the sourceLocation value. + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar + * or git repository. If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + * + * @param sourceLocation the sourceLocation value to set. + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + /** + * Get the credentials property: The properties that describes a set of credentials that will be used when this run + * is invoked. + * + * @return the credentials value. + */ + public Credentials credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The properties that describes a set of credentials that will be used when this run + * is invoked. + * + * @param credentials the credentials value to set. + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withCredentials(Credentials credentials) { + this.credentials = credentials; + return this; + } + + /** {@inheritDoc} */ + @Override + public FileTaskRunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { + super.withIsArchiveEnabled(isArchiveEnabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public FileTaskRunRequest withAgentPoolName(String agentPoolName) { + super.withAgentPoolName(agentPoolName); + return this; + } + + /** {@inheritDoc} */ + @Override + public FileTaskRunRequest withLogTemplate(String logTemplate) { + super.withLogTemplate(logTemplate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (taskFilePath() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property taskFilePath in model FileTaskRunRequest")); + } + if (values() != null) { + values().forEach(e -> e.validate()); + } + if (platform() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property platform in model FileTaskRunRequest")); + } else { + platform().validate(); + } + if (agentConfiguration() != null) { + agentConfiguration().validate(); + } + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskStep.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskStep.java new file mode 100644 index 0000000000000..6811825764e14 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskStep.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of a task step. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("FileTask") +@Fluent +public final class FileTaskStep extends TaskStepProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileTaskStep.class); + + /* + * The task template/definition file path relative to the source context. + */ + @JsonProperty(value = "taskFilePath", required = true) + private String taskFilePath; + + /* + * The task values/parameters file path relative to the source context. + */ + @JsonProperty(value = "valuesFilePath") + private String valuesFilePath; + + /* + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the taskFilePath property: The task template/definition file path relative to the source context. + * + * @return the taskFilePath value. + */ + public String taskFilePath() { + return this.taskFilePath; + } + + /** + * Set the taskFilePath property: The task template/definition file path relative to the source context. + * + * @param taskFilePath the taskFilePath value to set. + * @return the FileTaskStep object itself. + */ + public FileTaskStep withTaskFilePath(String taskFilePath) { + this.taskFilePath = taskFilePath; + return this; + } + + /** + * Get the valuesFilePath property: The task values/parameters file path relative to the source context. + * + * @return the valuesFilePath value. + */ + public String valuesFilePath() { + return this.valuesFilePath; + } + + /** + * Set the valuesFilePath property: The task values/parameters file path relative to the source context. + * + * @param valuesFilePath the valuesFilePath value to set. + * @return the FileTaskStep object itself. + */ + public FileTaskStep withValuesFilePath(String valuesFilePath) { + this.valuesFilePath = valuesFilePath; + return this; + } + + /** + * Get the values property: The collection of overridable values that can be passed when running a task. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The collection of overridable values that can be passed when running a task. + * + * @param values the values value to set. + * @return the FileTaskStep object itself. + */ + public FileTaskStep withValues(List values) { + this.values = values; + return this; + } + + /** {@inheritDoc} */ + @Override + public FileTaskStep withContextPath(String contextPath) { + super.withContextPath(contextPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public FileTaskStep withContextAccessToken(String contextAccessToken) { + super.withContextAccessToken(contextAccessToken); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (taskFilePath() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property taskFilePath in model FileTaskStep")); + } + if (values() != null) { + values().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskStepUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskStepUpdateParameters.java new file mode 100644 index 0000000000000..c94cae3507c10 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskStepUpdateParameters.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of updating a task step. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("FileTask") +@Fluent +public final class FileTaskStepUpdateParameters extends TaskStepUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileTaskStepUpdateParameters.class); + + /* + * The task template/definition file path relative to the source context. + */ + @JsonProperty(value = "taskFilePath") + private String taskFilePath; + + /* + * The values/parameters file path relative to the source context. + */ + @JsonProperty(value = "valuesFilePath") + private String valuesFilePath; + + /* + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the taskFilePath property: The task template/definition file path relative to the source context. + * + * @return the taskFilePath value. + */ + public String taskFilePath() { + return this.taskFilePath; + } + + /** + * Set the taskFilePath property: The task template/definition file path relative to the source context. + * + * @param taskFilePath the taskFilePath value to set. + * @return the FileTaskStepUpdateParameters object itself. + */ + public FileTaskStepUpdateParameters withTaskFilePath(String taskFilePath) { + this.taskFilePath = taskFilePath; + return this; + } + + /** + * Get the valuesFilePath property: The values/parameters file path relative to the source context. + * + * @return the valuesFilePath value. + */ + public String valuesFilePath() { + return this.valuesFilePath; + } + + /** + * Set the valuesFilePath property: The values/parameters file path relative to the source context. + * + * @param valuesFilePath the valuesFilePath value to set. + * @return the FileTaskStepUpdateParameters object itself. + */ + public FileTaskStepUpdateParameters withValuesFilePath(String valuesFilePath) { + this.valuesFilePath = valuesFilePath; + return this; + } + + /** + * Get the values property: The collection of overridable values that can be passed when running a task. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The collection of overridable values that can be passed when running a task. + * + * @param values the values value to set. + * @return the FileTaskStepUpdateParameters object itself. + */ + public FileTaskStepUpdateParameters withValues(List values) { + this.values = values; + return this; + } + + /** {@inheritDoc} */ + @Override + public FileTaskStepUpdateParameters withContextPath(String contextPath) { + super.withContextPath(contextPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public FileTaskStepUpdateParameters withContextAccessToken(String contextAccessToken) { + super.withContextAccessToken(contextAccessToken); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (values() != null) { + values().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsParameters.java new file mode 100644 index 0000000000000..9680c54158c35 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsParameters.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The parameters used to generate credentials for a specified token or user of a container registry. */ +@Fluent +public final class GenerateCredentialsParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenerateCredentialsParameters.class); + + /* + * The resource ID of the token for which credentials have to be generated. + */ + @JsonProperty(value = "tokenId") + private String tokenId; + + /* + * The expiry date of the generated credentials after which the credentials + * become invalid. + */ + @JsonProperty(value = "expiry") + private OffsetDateTime expiry; + + /* + * Specifies name of the password which should be regenerated if any -- + * password1 or password2. + */ + @JsonProperty(value = "name") + private TokenPasswordName name; + + /** + * Get the tokenId property: The resource ID of the token for which credentials have to be generated. + * + * @return the tokenId value. + */ + public String tokenId() { + return this.tokenId; + } + + /** + * Set the tokenId property: The resource ID of the token for which credentials have to be generated. + * + * @param tokenId the tokenId value to set. + * @return the GenerateCredentialsParameters object itself. + */ + public GenerateCredentialsParameters withTokenId(String tokenId) { + this.tokenId = tokenId; + return this; + } + + /** + * Get the expiry property: The expiry date of the generated credentials after which the credentials become invalid. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: The expiry date of the generated credentials after which the credentials become invalid. + * + * @param expiry the expiry value to set. + * @return the GenerateCredentialsParameters object itself. + */ + public GenerateCredentialsParameters withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get the name property: Specifies name of the password which should be regenerated if any -- password1 or + * password2. + * + * @return the name value. + */ + public TokenPasswordName name() { + return this.name; + } + + /** + * Set the name property: Specifies name of the password which should be regenerated if any -- password1 or + * password2. + * + * @param name the name value to set. + * @return the GenerateCredentialsParameters object itself. + */ + public GenerateCredentialsParameters withName(TokenPasswordName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsResult.java new file mode 100644 index 0000000000000..1243265f7e4e9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner; +import java.util.List; + +/** An immutable client-side representation of GenerateCredentialsResult. */ +public interface GenerateCredentialsResult { + /** + * Gets the username property: The username for a container registry. + * + * @return the username value. + */ + String username(); + + /** + * Gets the passwords property: The list of passwords for a container registry. + * + * @return the passwords value. + */ + List passwords(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner + * object. + * + * @return the inner object. + */ + GenerateCredentialsResultInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IdentityProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IdentityProperties.java new file mode 100644 index 0000000000000..24b87f00d20b3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IdentityProperties.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed identity for the resource. */ +@Fluent +public final class IdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProperties.class); + + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with the resource. The user + * identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID of resource identity. + * + * @param principalId the principalId value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant ID of resource. + * + * @param tenantId the tenantId value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImageDescriptor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImageDescriptor.java new file mode 100644 index 0000000000000..11ab73a45c282 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImageDescriptor.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for a registry image. */ +@Fluent +public final class ImageDescriptor { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageDescriptor.class); + + /* + * 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 property: The registry login server. + * + * @return the registry value. + */ + public String registry() { + return this.registry; + } + + /** + * Set the registry property: 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 property: The repository name. + * + * @return the repository value. + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository property: 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 property: The tag name. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: 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 digest property: The sha256-based digest of the image manifest. + * + * @return the digest value. + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImageUpdateTrigger.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImageUpdateTrigger.java new file mode 100644 index 0000000000000..254c2caa2d150 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImageUpdateTrigger.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The image update trigger that caused a build. */ +@Fluent +public final class ImageUpdateTrigger { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageUpdateTrigger.class); + + /* + * The unique ID of the trigger. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The timestamp when the image update happened. + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /* + * The list of image updates that caused the build. + */ + @JsonProperty(value = "images") + private List images; + + /** + * Get the id property: The unique ID of the trigger. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: 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 property: The timestamp when the image update happened. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The timestamp when the image update happened. + * + * @param timestamp the timestamp value to set. + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the images property: The list of image updates that caused the build. + * + * @return the images value. + */ + public List images() { + return this.images; + } + + /** + * Set the images property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (images() != null) { + images().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportImageParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportImageParameters.java new file mode 100644 index 0000000000000..7e681f41126ad --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportImageParameters.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ImportImageParameters model. */ +@Fluent +public final class ImportImageParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImportImageParameters.class); + + /* + * 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. + */ + @JsonProperty(value = "mode") + private ImportMode mode; + + /** + * Get the source property: The source of the image. + * + * @return the source value. + */ + public ImportSource source() { + return this.source; + } + + /** + * Set the source property: 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 the targetTags property: 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 the targetTags property: 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 the untaggedTargetRepositories property: 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 the untaggedTargetRepositories property: 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 the mode property: When Force, any existing target tags will be overwritten. When NoForce, any existing + * target tags will fail the operation before any copying begins. + * + * @return the mode value. + */ + public ImportMode mode() { + return this.mode; + } + + /** + * Set the mode property: When Force, any existing target tags will be overwritten. When NoForce, any existing + * target tags will fail the operation before any copying begins. + * + * @param mode the mode value to set. + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withMode(ImportMode mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property source in model ImportImageParameters")); + } else { + source().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportMode.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportMode.java new file mode 100644 index 0000000000000..70b0ad906c51d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ImportMode. */ +public final class ImportMode extends ExpandableStringEnum { + /** Static value NoForce for ImportMode. */ + public static final ImportMode NO_FORCE = fromString("NoForce"); + + /** Static value Force for ImportMode. */ + public static final ImportMode FORCE = fromString("Force"); + + /** + * Creates or finds a ImportMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImportMode. + */ + @JsonCreator + public static ImportMode fromString(String name) { + return fromString(name, ImportMode.class); + } + + /** @return known ImportMode values. */ + public static Collection values() { + return values(ImportMode.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipeline.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipeline.java new file mode 100644 index 0000000000000..d2e1373ba2119 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipeline.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +import java.util.List; + +/** An immutable client-side representation of ImportPipeline. */ +public interface ImportPipeline { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the import pipeline. + * + * @return the location value. + */ + String location(); + + /** + * Gets the identity property: The identity of the import pipeline. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the source property: The source properties of the import pipeline. + * + * @return the source value. + */ + ImportPipelineSourceProperties source(); + + /** + * Gets the trigger property: The properties that describe the trigger of the import pipeline. + * + * @return the trigger value. + */ + PipelineTriggerProperties trigger(); + + /** + * Gets the options property: The list of all options configured for the pipeline. + * + * @return the options value. + */ + List options(); + + /** + * Gets the provisioningState property: The provisioning state of the pipeline at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner object. + * + * @return the inner object. + */ + ImportPipelineInner innerModel(); + + /** The entirety of the ImportPipeline definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ImportPipeline definition stages. */ + interface DefinitionStages { + /** The first stage of the ImportPipeline definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ImportPipeline definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the ImportPipeline definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithIdentity, + DefinitionStages.WithSource, + DefinitionStages.WithTrigger, + DefinitionStages.WithOptions { + /** + * Executes the create request. + * + * @return the created resource. + */ + ImportPipeline create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ImportPipeline create(Context context); + } + /** The stage of the ImportPipeline definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the import pipeline. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the import pipeline. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the ImportPipeline definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the import pipeline.. + * + * @param identity The identity of the import pipeline. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + /** The stage of the ImportPipeline definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The source properties of the import pipeline.. + * + * @param source The source properties of the import pipeline. + * @return the next definition stage. + */ + WithCreate withSource(ImportPipelineSourceProperties source); + } + /** The stage of the ImportPipeline definition allowing to specify trigger. */ + interface WithTrigger { + /** + * Specifies the trigger property: The properties that describe the trigger of the import pipeline.. + * + * @param trigger The properties that describe the trigger of the import pipeline. + * @return the next definition stage. + */ + WithCreate withTrigger(PipelineTriggerProperties trigger); + } + /** The stage of the ImportPipeline definition allowing to specify options. */ + interface WithOptions { + /** + * Specifies the options property: The list of all options configured for the pipeline.. + * + * @param options The list of all options configured for the pipeline. + * @return the next definition stage. + */ + WithCreate withOptions(List options); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ImportPipeline refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ImportPipeline refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineListResult.java new file mode 100644 index 0000000000000..f68b9301936c3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list import pipelines for a container registry. */ +@Fluent +public final class ImportPipelineListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImportPipelineListResult.class); + + /* + * The list of import pipelines. Since this list may be incomplete, the + * nextLink field should be used to request the next list of import + * pipelines. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of pipeline runs. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of import pipelines. Since this list may be incomplete, the nextLink field + * should be used to request the next list of import pipelines. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of import pipelines. Since this list may be incomplete, the nextLink field + * should be used to request the next list of import pipelines. + * + * @param value the value value to set. + * @return the ImportPipelineListResult object itself. + */ + public ImportPipelineListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @param nextLink the nextLink value to set. + * @return the ImportPipelineListResult object itself. + */ + public ImportPipelineListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineSourceProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineSourceProperties.java new file mode 100644 index 0000000000000..96b31b442bde8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineSourceProperties.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the import pipeline source. */ +@Fluent +public final class ImportPipelineSourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImportPipelineSourceProperties.class); + + /* + * The type of source for the import pipeline. + */ + @JsonProperty(value = "type") + private PipelineSourceType type; + + /* + * The source uri of the import pipeline. + * When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" + * When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName" + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * They key vault secret uri to obtain the source storage SAS token. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String keyVaultUri; + + /** + * Get the type property: The type of source for the import pipeline. + * + * @return the type value. + */ + public PipelineSourceType type() { + return this.type; + } + + /** + * Set the type property: The type of source for the import pipeline. + * + * @param type the type value to set. + * @return the ImportPipelineSourceProperties object itself. + */ + public ImportPipelineSourceProperties withType(PipelineSourceType type) { + this.type = type; + return this; + } + + /** + * Get the uri property: The source uri of the import pipeline. When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName". + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The source uri of the import pipeline. When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName". + * + * @param uri the uri value to set. + * @return the ImportPipelineSourceProperties object itself. + */ + public ImportPipelineSourceProperties withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the keyVaultUri property: They key vault secret uri to obtain the source storage SAS token. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: They key vault secret uri to obtain the source storage SAS token. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the ImportPipelineSourceProperties object itself. + */ + public ImportPipelineSourceProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultUri in model ImportPipelineSourceProperties")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelines.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelines.java new file mode 100644 index 0000000000000..af7531e87cafd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelines.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ImportPipelines. */ +public interface ImportPipelines { + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + ImportPipeline get(String resourceGroupName, String registryName, String importPipelineName); + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String importPipelineName); + + /** + * Deletes an import pipeline 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 importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Lists all import pipelines 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all import pipelines 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the import pipeline. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + ImportPipeline getById(String id); + + /** + * Gets the properties of the import pipeline. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an import pipeline from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an import pipeline from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ImportPipeline resource. + * + * @param name resource name. + * @return the first stage of the new ImportPipeline definition. + */ + ImportPipeline.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSource.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSource.java new file mode 100644 index 0000000000000..7e1f15f1f76a6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSource.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ImportSource model. */ +@Fluent +public final class ImportSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImportSource.class); + + /* + * The resource identifier of the source Azure Container Registry. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The address of the source registry (e.g. 'mcr.microsoft.com'). + */ + @JsonProperty(value = "registryUri") + private String registryUri; + + /* + * Credentials used when importing from a registry uri. + */ + @JsonProperty(value = "credentials") + private ImportSourceCredentials credentials; + + /* + * Repository name of the source image. + * Specify an image by repository ('hello-world'). This will use the + * 'latest' tag. + * Specify an image by tag ('hello-world:latest'). + * Specify an image by sha256-based manifest digest + * ('hello-world@sha256:abc123'). + */ + @JsonProperty(value = "sourceImage", required = true) + private String sourceImage; + + /** + * Get the resourceId property: The resource identifier of the source Azure Container Registry. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource identifier of the source Azure Container Registry. + * + * @param resourceId the resourceId value to set. + * @return the ImportSource object itself. + */ + public ImportSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the registryUri property: The address of the source registry (e.g. 'mcr.microsoft.com'). + * + * @return the registryUri value. + */ + public String registryUri() { + return this.registryUri; + } + + /** + * Set the registryUri property: The address of the source registry (e.g. 'mcr.microsoft.com'). + * + * @param registryUri the registryUri value to set. + * @return the ImportSource object itself. + */ + public ImportSource withRegistryUri(String registryUri) { + this.registryUri = registryUri; + return this; + } + + /** + * Get the credentials property: Credentials used when importing from a registry uri. + * + * @return the credentials value. + */ + public ImportSourceCredentials credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Credentials used when importing from a registry uri. + * + * @param credentials the credentials value to set. + * @return the ImportSource object itself. + */ + public ImportSource withCredentials(ImportSourceCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the sourceImage property: 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 the sourceImage property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + if (sourceImage() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sourceImage in model ImportSource")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSourceCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSourceCredentials.java new file mode 100644 index 0000000000000..5ec68485cd4ba --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSourceCredentials.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ImportSourceCredentials model. */ +@Fluent +public final class ImportSourceCredentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImportSourceCredentials.class); + + /* + * The username to authenticate with the source registry. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The password used to authenticate with the source registry. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /** + * Get the username property: The username to authenticate with the source registry. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username to authenticate with the source registry. + * + * @param username the username value to set. + * @return the ImportSourceCredentials object itself. + */ + public ImportSourceCredentials withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password used to authenticate with the source registry. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password used to authenticate with the source registry. + * + * @param password the password value to set. + * @return the ImportSourceCredentials object itself. + */ + public ImportSourceCredentials withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (password() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property password in model ImportSourceCredentials")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IpRule.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IpRule.java new file mode 100644 index 0000000000000..289313e3752aa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IpRule.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP rule with specific IP or IP range in CIDR format. */ +@Fluent +public final class IpRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpRule.class); + + /* + * The action of IP ACL rule. + */ + @JsonProperty(value = "action") + private Action action; + + /* + * Specifies the IP or IP range in CIDR format. Only IPV4 address is + * allowed. + */ + @JsonProperty(value = "value", required = true) + private String ipAddressOrRange; + + /** + * Get the action property: The action of IP ACL rule. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of IP ACL rule. + * + * @param action the action value to set. + * @return the IpRule object itself. + */ + public IpRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @return the ipAddressOrRange value. + */ + public String ipAddressOrRange() { + return this.ipAddressOrRange; + } + + /** + * Set the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @param ipAddressOrRange the ipAddressOrRange value to set. + * @return the IpRule object itself. + */ + public IpRule withIpAddressOrRange(String ipAddressOrRange) { + this.ipAddressOrRange = ipAddressOrRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddressOrRange() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipAddressOrRange in model IpRule")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/KeyVaultProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/KeyVaultProperties.java new file mode 100644 index 0000000000000..3f5dd156b5130 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/KeyVaultProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The KeyVaultProperties model. */ +@Fluent +public final class KeyVaultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultProperties.class); + + /* + * Key vault uri to access the encryption key. + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /* + * The fully qualified key identifier that includes the version of the key + * that is actually used for encryption. + */ + @JsonProperty(value = "versionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String versionedKeyIdentifier; + + /* + * The client id of the identity which will be used to access key vault. + */ + @JsonProperty(value = "identity") + private String identity; + + /* + * Auto key rotation status for a CMK enabled registry. + */ + @JsonProperty(value = "keyRotationEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean keyRotationEnabled; + + /* + * Timestamp of the last successful key rotation. + */ + @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastKeyRotationTimestamp; + + /** + * Get the keyIdentifier property: Key vault uri to access the encryption key. + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: Key vault uri to access the encryption key. + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the versionedKeyIdentifier property: The fully qualified key identifier that includes the version of the key + * that is actually used for encryption. + * + * @return the versionedKeyIdentifier value. + */ + public String versionedKeyIdentifier() { + return this.versionedKeyIdentifier; + } + + /** + * Get the identity property: The client id of the identity which will be used to access key vault. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The client id of the identity which will be used to access key vault. + * + * @param identity the identity value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Get the keyRotationEnabled property: Auto key rotation status for a CMK enabled registry. + * + * @return the keyRotationEnabled value. + */ + public Boolean keyRotationEnabled() { + return this.keyRotationEnabled; + } + + /** + * Get the lastKeyRotationTimestamp property: Timestamp of the last successful key rotation. + * + * @return the lastKeyRotationTimestamp value. + */ + public OffsetDateTime lastKeyRotationTimestamp() { + return this.lastKeyRotationTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LogLevel.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LogLevel.java new file mode 100644 index 0000000000000..3087a01535479 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LogLevel.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogLevel. */ +public final class LogLevel extends ExpandableStringEnum { + /** Static value Debug for LogLevel. */ + public static final LogLevel DEBUG = fromString("Debug"); + + /** Static value Information for LogLevel. */ + public static final LogLevel INFORMATION = fromString("Information"); + + /** Static value Warning for LogLevel. */ + public static final LogLevel WARNING = fromString("Warning"); + + /** Static value Error for LogLevel. */ + public static final LogLevel ERROR = fromString("Error"); + + /** Static value None for LogLevel. */ + public static final LogLevel NONE = fromString("None"); + + /** + * Creates or finds a LogLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogLevel. + */ + @JsonCreator + public static LogLevel fromString(String name) { + return fromString(name, LogLevel.class); + } + + /** @return known LogLevel values. */ + public static Collection values() { + return values(LogLevel.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoggingProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoggingProperties.java new file mode 100644 index 0000000000000..afd16c187a543 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoggingProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The logging properties of the connected registry. */ +@Fluent +public final class LoggingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggingProperties.class); + + /* + * The verbosity of logs persisted on the connected registry. + */ + @JsonProperty(value = "logLevel") + private LogLevel logLevel; + + /* + * Indicates whether audit logs are enabled on the connected registry. + */ + @JsonProperty(value = "auditLogStatus") + private AuditLogStatus auditLogStatus; + + /** + * Get the logLevel property: The verbosity of logs persisted on the connected registry. + * + * @return the logLevel value. + */ + public LogLevel logLevel() { + return this.logLevel; + } + + /** + * Set the logLevel property: The verbosity of logs persisted on the connected registry. + * + * @param logLevel the logLevel value to set. + * @return the LoggingProperties object itself. + */ + public LoggingProperties withLogLevel(LogLevel logLevel) { + this.logLevel = logLevel; + return this; + } + + /** + * Get the auditLogStatus property: Indicates whether audit logs are enabled on the connected registry. + * + * @return the auditLogStatus value. + */ + public AuditLogStatus auditLogStatus() { + return this.auditLogStatus; + } + + /** + * Set the auditLogStatus property: Indicates whether audit logs are enabled on the connected registry. + * + * @param auditLogStatus the auditLogStatus value to set. + * @return the LoggingProperties object itself. + */ + public LoggingProperties withAuditLogStatus(AuditLogStatus auditLogStatus) { + this.auditLogStatus = auditLogStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoginServerProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoginServerProperties.java new file mode 100644 index 0000000000000..d4428a5335d44 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoginServerProperties.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The login server properties of the connected registry. */ +@Immutable +public final class LoginServerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoginServerProperties.class); + + /* + * The host of the connected registry. Can be FQDN or IP. + */ + @JsonProperty(value = "host", access = JsonProperty.Access.WRITE_ONLY) + private String host; + + /* + * The TLS properties of the connected registry login server. + */ + @JsonProperty(value = "tls", access = JsonProperty.Access.WRITE_ONLY) + private TlsProperties tls; + + /** + * Get the host property: The host of the connected registry. Can be FQDN or IP. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Get the tls property: The TLS properties of the connected registry login server. + * + * @return the tls value. + */ + public TlsProperties tls() { + return this.tls; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tls() != null) { + tls().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleBypassOptions.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleBypassOptions.java new file mode 100644 index 0000000000000..321831db43350 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleBypassOptions.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkRuleBypassOptions. */ +public final class NetworkRuleBypassOptions extends ExpandableStringEnum { + /** Static value AzureServices for NetworkRuleBypassOptions. */ + public static final NetworkRuleBypassOptions AZURE_SERVICES = fromString("AzureServices"); + + /** Static value None for NetworkRuleBypassOptions. */ + public static final NetworkRuleBypassOptions NONE = fromString("None"); + + /** + * Creates or finds a NetworkRuleBypassOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkRuleBypassOptions. + */ + @JsonCreator + public static NetworkRuleBypassOptions fromString(String name) { + return fromString(name, NetworkRuleBypassOptions.class); + } + + /** @return known NetworkRuleBypassOptions values. */ + public static Collection values() { + return values(NetworkRuleBypassOptions.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleSet.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleSet.java new file mode 100644 index 0000000000000..bcee80001bd50 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleSet.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network rule set for a container registry. */ +@Fluent +public final class NetworkRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSet.class); + + /* + * The default action of allow or deny when no other rules match. + */ + @JsonProperty(value = "defaultAction", required = true) + private DefaultAction defaultAction; + + /* + * The virtual network rules. + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /* + * The IP ACL rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** + * Get the defaultAction property: The default action of allow or deny when no other rules match. + * + * @return the defaultAction value. + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: The default action of allow or deny when no other rules match. + * + * @param defaultAction the defaultAction value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the virtualNetworkRules property: The virtual network rules. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the virtualNetworkRules property: The virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get the ipRules property: The IP ACL rules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: The IP ACL rules. + * + * @param ipRules the ipRules value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (defaultAction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property defaultAction in model NetworkRuleSet")); + } + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OS.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OS.java new file mode 100644 index 0000000000000..7fbadb18004ec --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OS.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OS. */ +public final class OS extends ExpandableStringEnum { + /** Static value Windows for OS. */ + public static final OS WINDOWS = fromString("Windows"); + + /** Static value Linux for OS. */ + public static final OS LINUX = fromString("Linux"); + + /** + * Creates or finds a OS from its string representation. + * + * @param name a name to look for. + * @return the corresponding OS. + */ + @JsonCreator + public static OS fromString(String name) { + return fromString(name, OS.class); + } + + /** @return known OS values. */ + public static Collection values() { + return values(OS.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDefinition.java new file mode 100644 index 0000000000000..e25591c7c71f8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDefinition.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; + +/** An immutable client-side representation of OperationDefinition. */ +public interface OperationDefinition { + /** + * Gets the origin property: The origin information of the container registry operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The display information for the container registry operation. + * + * @return the display value. + */ + OperationDisplayDefinition display(); + + /** + * Gets the isDataAction property: This property indicates if the operation is an action or a data action ref: + * https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the serviceSpecification property: The definition of Azure Monitoring service. + * + * @return the serviceSpecification value. + */ + OperationServiceSpecificationDefinition serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner + * object. + * + * @return the inner object. + */ + OperationDefinitionInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDisplayDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDisplayDefinition.java new file mode 100644 index 0000000000000..79ba76906a605 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDisplayDefinition.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The display information for a container registry operation. */ +@Fluent +public final class OperationDisplayDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplayDefinition.class); + + /* + * 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 provider property: The resource provider name: Microsoft.ContainerRegistry. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: 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 property: The resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: 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 property: The operation that users can perform. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: 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 property: The description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..847aed25bce5e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list container registry operations. */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * The list of container registry operations. Since this list may be + * incomplete, the nextLink field should be used to request the next list + * of operations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of container registry + * operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of container registry operations. Since this list may be incomplete, the + * nextLink field should be used to request the next list of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of container registry operations. Since this list may be incomplete, the + * nextLink field should be used to request the next list of operations. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of container registry operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of container registry operations. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationLogSpecificationDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationLogSpecificationDefinition.java new file mode 100644 index 0000000000000..5a1f1080337ec --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationLogSpecificationDefinition.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of Azure Monitoring log. */ +@Fluent +public final class OperationLogSpecificationDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationLogSpecificationDefinition.class); + + /* + * Log name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Log display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Log blob duration. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: Log name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Log name. + * + * @param name the name value to set. + * @return the OperationLogSpecificationDefinition object itself. + */ + public OperationLogSpecificationDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Log display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Log display name. + * + * @param displayName the displayName value to set. + * @return the OperationLogSpecificationDefinition object itself. + */ + public OperationLogSpecificationDefinition withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Log blob duration. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Log blob duration. + * + * @param blobDuration the blobDuration value to set. + * @return the OperationLogSpecificationDefinition object itself. + */ + public OperationLogSpecificationDefinition withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationMetricSpecificationDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationMetricSpecificationDefinition.java new file mode 100644 index 0000000000000..68b81924653eb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationMetricSpecificationDefinition.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of Azure Monitoring metric. */ +@Fluent +public final class OperationMetricSpecificationDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetricSpecificationDefinition.class); + + /* + * Metric name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Metric display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Metric description. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Metric unit. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Metric aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Internal metric name. + */ + @JsonProperty(value = "internalMetricName") + private String internalMetricName; + + /** + * Get the name property: Metric name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Metric name. + * + * @param name the name value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Metric display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Metric display name. + * + * @param displayName the displayName value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Metric description. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Metric description. + * + * @param displayDescription the displayDescription value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Metric unit. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Metric unit. + * + * @param unit the unit value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: Metric aggregation type. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Metric aggregation type. + * + * @param aggregationType the aggregationType value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the internalMetricName property: Internal metric name. + * + * @return the internalMetricName value. + */ + public String internalMetricName() { + return this.internalMetricName; + } + + /** + * Set the internalMetricName property: Internal metric name. + * + * @param internalMetricName the internalMetricName value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withInternalMetricName(String internalMetricName) { + this.internalMetricName = internalMetricName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationServiceSpecificationDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationServiceSpecificationDefinition.java new file mode 100644 index 0000000000000..a8c1eb77ef406 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationServiceSpecificationDefinition.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The definition of Azure Monitoring list. */ +@Fluent +public final class OperationServiceSpecificationDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationServiceSpecificationDefinition.class); + + /* + * A list of Azure Monitoring metrics definition. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /* + * A list of Azure Monitoring log definitions. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get the metricSpecifications property: A list of Azure Monitoring metrics definition. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: A list of Azure Monitoring metrics definition. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the OperationServiceSpecificationDefinition object itself. + */ + public OperationServiceSpecificationDefinition withMetricSpecifications( + List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get the logSpecifications property: A list of Azure Monitoring log definitions. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: A list of Azure Monitoring log definitions. + * + * @param logSpecifications the logSpecifications value to set. + * @return the OperationServiceSpecificationDefinition object itself. + */ + public OperationServiceSpecificationDefinition withLogSpecifications( + List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Operations.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Operations.java new file mode 100644 index 0000000000000..5e4cad2c5e7d0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + PagedIterable list(); + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OverrideTaskStepProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OverrideTaskStepProperties.java new file mode 100644 index 0000000000000..c50cfa494b4d4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OverrideTaskStepProperties.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The OverrideTaskStepProperties model. */ +@Fluent +public final class OverrideTaskStepProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OverrideTaskStepProperties.class); + + /* + * The source context against which run has to be queued. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /* + * The file against which run has to be queued. + */ + @JsonProperty(value = "file") + private String file; + + /* + * Gets or sets the collection of override arguments to be used when + * executing a build step. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /* + * The name of the target build stage for the docker build. + */ + @JsonProperty(value = "target") + private String target; + + /* + * The collection of overridable values that can be passed when running a + * Task. + */ + @JsonProperty(value = "values") + private List values; + + /* + * Base64 encoded update trigger token that will be attached with the base + * image trigger webhook. + */ + @JsonProperty(value = "updateTriggerToken") + private String updateTriggerToken; + + /** + * Get the contextPath property: The source context against which run has to be queued. + * + * @return the contextPath value. + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the contextPath property: The source context against which run has to be queued. + * + * @param contextPath the contextPath value to set. + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the file property: The file against which run has to be queued. + * + * @return the file value. + */ + public String file() { + return this.file; + } + + /** + * Set the file property: The file against which run has to be queued. + * + * @param file the file value to set. + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withFile(String file) { + this.file = file; + return this; + } + + /** + * Get the arguments property: Gets or sets the collection of override arguments to be used when executing a build + * step. + * + * @return the arguments value. + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the arguments property: Gets or sets the collection of override arguments to be used when executing a build + * step. + * + * @param arguments the arguments value to set. + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the target property: The name of the target build stage for the docker build. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The name of the target build stage for the docker build. + * + * @param target the target value to set. + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the values property: The collection of overridable values that can be passed when running a Task. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The collection of overridable values that can be passed when running a Task. + * + * @param values the values value to set. + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withValues(List values) { + this.values = values; + return this; + } + + /** + * Get the updateTriggerToken property: Base64 encoded update trigger token that will be attached with the base + * image trigger webhook. + * + * @return the updateTriggerToken value. + */ + public String updateTriggerToken() { + return this.updateTriggerToken; + } + + /** + * Set the updateTriggerToken property: Base64 encoded update trigger token that will be attached with the base + * image trigger webhook. + * + * @param updateTriggerToken the updateTriggerToken value to set. + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withUpdateTriggerToken(String updateTriggerToken) { + this.updateTriggerToken = updateTriggerToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (arguments() != null) { + arguments().forEach(e -> e.validate()); + } + if (values() != null) { + values().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ParentProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ParentProperties.java new file mode 100644 index 0000000000000..d57857aa49352 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ParentProperties.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the connected registry parent. */ +@Fluent +public final class ParentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ParentProperties.class); + + /* + * The resource ID of the parent to which the connected registry will be + * associated. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The sync properties of the connected registry with its parent. + */ + @JsonProperty(value = "syncProperties", required = true) + private SyncProperties syncProperties; + + /** + * Get the id property: The resource ID of the parent to which the connected registry will be associated. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource ID of the parent to which the connected registry will be associated. + * + * @param id the id value to set. + * @return the ParentProperties object itself. + */ + public ParentProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the syncProperties property: The sync properties of the connected registry with its parent. + * + * @return the syncProperties value. + */ + public SyncProperties syncProperties() { + return this.syncProperties; + } + + /** + * Set the syncProperties property: The sync properties of the connected registry with its parent. + * + * @param syncProperties the syncProperties value to set. + * @return the ParentProperties object itself. + */ + public ParentProperties withSyncProperties(SyncProperties syncProperties) { + this.syncProperties = syncProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (syncProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property syncProperties in model ParentProperties")); + } else { + syncProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PasswordName.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PasswordName.java new file mode 100644 index 0000000000000..e282c7701e0b9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PasswordName.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +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 final String value; + + PasswordName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PasswordName instance. + * + * @param value the serialized value to parse. + * @return the parsed PasswordName object, or null if unable to parse. + */ + @JsonCreator + public static PasswordName fromString(String value) { + PasswordName[] items = PasswordName.values(); + for (PasswordName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineOptions.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineOptions.java new file mode 100644 index 0000000000000..41f117426ee23 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineOptions.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PipelineOptions. */ +public final class PipelineOptions extends ExpandableStringEnum { + /** Static value OverwriteTags for PipelineOptions. */ + public static final PipelineOptions OVERWRITE_TAGS = fromString("OverwriteTags"); + + /** Static value OverwriteBlobs for PipelineOptions. */ + public static final PipelineOptions OVERWRITE_BLOBS = fromString("OverwriteBlobs"); + + /** Static value DeleteSourceBlobOnSuccess for PipelineOptions. */ + public static final PipelineOptions DELETE_SOURCE_BLOB_ON_SUCCESS = fromString("DeleteSourceBlobOnSuccess"); + + /** Static value ContinueOnErrors for PipelineOptions. */ + public static final PipelineOptions CONTINUE_ON_ERRORS = fromString("ContinueOnErrors"); + + /** + * Creates or finds a PipelineOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding PipelineOptions. + */ + @JsonCreator + public static PipelineOptions fromString(String name) { + return fromString(name, PipelineOptions.class); + } + + /** @return known PipelineOptions values. */ + public static Collection values() { + return values(PipelineOptions.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRun.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRun.java new file mode 100644 index 0000000000000..c330ee5c1bb38 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRun.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; + +/** An immutable client-side representation of PipelineRun. */ +public interface PipelineRun { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the provisioningState property: The provisioning state of a pipeline run. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the request property: The request parameters for a pipeline run. + * + * @return the request value. + */ + PipelineRunRequest request(); + + /** + * Gets the response property: The response of a pipeline run. + * + * @return the response value. + */ + PipelineRunResponse response(); + + /** + * Gets the forceUpdateTag property: How the pipeline run should be forced to recreate even if the pipeline run + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner object. + * + * @return the inner object. + */ + PipelineRunInner innerModel(); + + /** The entirety of the PipelineRun definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PipelineRun definition stages. */ + interface DefinitionStages { + /** The first stage of the PipelineRun definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PipelineRun definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the PipelineRun definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithRequest, DefinitionStages.WithForceUpdateTag { + /** + * Executes the create request. + * + * @return the created resource. + */ + PipelineRun create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PipelineRun create(Context context); + } + /** The stage of the PipelineRun definition allowing to specify request. */ + interface WithRequest { + /** + * Specifies the request property: The request parameters for a pipeline run.. + * + * @param request The request parameters for a pipeline run. + * @return the next definition stage. + */ + WithCreate withRequest(PipelineRunRequest request); + } + /** The stage of the PipelineRun definition allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the pipeline run should be forced to recreate even if the + * pipeline run configuration has not changed.. + * + * @param forceUpdateTag How the pipeline run should be forced to recreate even if the pipeline run + * configuration has not changed. + * @return the next definition stage. + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PipelineRun refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PipelineRun refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunListResult.java new file mode 100644 index 0000000000000..061ca7af12070 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list pipeline runs for a container registry. */ +@Fluent +public final class PipelineRunListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineRunListResult.class); + + /* + * The list of pipeline runs. Since this list may be incomplete, the + * nextLink field should be used to request the next list of pipeline runs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of pipeline runs. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of pipeline runs. Since this list may be incomplete, the nextLink field should + * be used to request the next list of pipeline runs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of pipeline runs. Since this list may be incomplete, the nextLink field should + * be used to request the next list of pipeline runs. + * + * @param value the value value to set. + * @return the PipelineRunListResult object itself. + */ + public PipelineRunListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @param nextLink the nextLink value to set. + * @return the PipelineRunListResult object itself. + */ + public PipelineRunListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunRequest.java new file mode 100644 index 0000000000000..213fb03cd49f0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunRequest.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The request properties provided for a pipeline run. */ +@Fluent +public final class PipelineRunRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineRunRequest.class); + + /* + * The resource ID of the pipeline to run. + */ + @JsonProperty(value = "pipelineResourceId") + private String pipelineResourceId; + + /* + * List of source artifacts to be transferred by the pipeline. + * 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 = "artifacts") + private List artifacts; + + /* + * The source properties of the pipeline run. + */ + @JsonProperty(value = "source") + private PipelineRunSourceProperties source; + + /* + * The target properties of the pipeline run. + */ + @JsonProperty(value = "target") + private PipelineRunTargetProperties target; + + /* + * The digest of the tar used to transfer the artifacts. + */ + @JsonProperty(value = "catalogDigest") + private String catalogDigest; + + /** + * Get the pipelineResourceId property: The resource ID of the pipeline to run. + * + * @return the pipelineResourceId value. + */ + public String pipelineResourceId() { + return this.pipelineResourceId; + } + + /** + * Set the pipelineResourceId property: The resource ID of the pipeline to run. + * + * @param pipelineResourceId the pipelineResourceId value to set. + * @return the PipelineRunRequest object itself. + */ + public PipelineRunRequest withPipelineResourceId(String pipelineResourceId) { + this.pipelineResourceId = pipelineResourceId; + return this; + } + + /** + * Get the artifacts property: List of source artifacts to be transferred by the pipeline. 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 artifacts value. + */ + public List artifacts() { + return this.artifacts; + } + + /** + * Set the artifacts property: List of source artifacts to be transferred by the pipeline. 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 artifacts the artifacts value to set. + * @return the PipelineRunRequest object itself. + */ + public PipelineRunRequest withArtifacts(List artifacts) { + this.artifacts = artifacts; + return this; + } + + /** + * Get the source property: The source properties of the pipeline run. + * + * @return the source value. + */ + public PipelineRunSourceProperties source() { + return this.source; + } + + /** + * Set the source property: The source properties of the pipeline run. + * + * @param source the source value to set. + * @return the PipelineRunRequest object itself. + */ + public PipelineRunRequest withSource(PipelineRunSourceProperties source) { + this.source = source; + return this; + } + + /** + * Get the target property: The target properties of the pipeline run. + * + * @return the target value. + */ + public PipelineRunTargetProperties target() { + return this.target; + } + + /** + * Set the target property: The target properties of the pipeline run. + * + * @param target the target value to set. + * @return the PipelineRunRequest object itself. + */ + public PipelineRunRequest withTarget(PipelineRunTargetProperties target) { + this.target = target; + return this; + } + + /** + * Get the catalogDigest property: The digest of the tar used to transfer the artifacts. + * + * @return the catalogDigest value. + */ + public String catalogDigest() { + return this.catalogDigest; + } + + /** + * Set the catalogDigest property: The digest of the tar used to transfer the artifacts. + * + * @param catalogDigest the catalogDigest value to set. + * @return the PipelineRunRequest object itself. + */ + public PipelineRunRequest withCatalogDigest(String catalogDigest) { + this.catalogDigest = catalogDigest; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (target() != null) { + target().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunResponse.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunResponse.java new file mode 100644 index 0000000000000..adc5c423dd827 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunResponse.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The response properties returned for a pipeline run. */ +@Fluent +public final class PipelineRunResponse { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineRunResponse.class); + + /* + * The current status of the pipeline run. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The artifacts imported in the pipeline run. + */ + @JsonProperty(value = "importedArtifacts") + private List importedArtifacts; + + /* + * The current progress of the copy operation. + */ + @JsonProperty(value = "progress") + private ProgressProperties progress; + + /* + * The time the pipeline run started. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The time the pipeline run finished. + */ + @JsonProperty(value = "finishTime") + private OffsetDateTime finishTime; + + /* + * The source of the pipeline run. + */ + @JsonProperty(value = "source") + private ImportPipelineSourceProperties source; + + /* + * The target of the pipeline run. + */ + @JsonProperty(value = "target") + private ExportPipelineTargetProperties target; + + /* + * The digest of the tar used to transfer the artifacts. + */ + @JsonProperty(value = "catalogDigest") + private String catalogDigest; + + /* + * The trigger that caused the pipeline run. + */ + @JsonProperty(value = "trigger") + private PipelineTriggerDescriptor trigger; + + /* + * The detailed error message for the pipeline run in the case of failure. + */ + @JsonProperty(value = "pipelineRunErrorMessage") + private String pipelineRunErrorMessage; + + /** + * Get the status property: The current status of the pipeline run. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The current status of the pipeline run. + * + * @param status the status value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the importedArtifacts property: The artifacts imported in the pipeline run. + * + * @return the importedArtifacts value. + */ + public List importedArtifacts() { + return this.importedArtifacts; + } + + /** + * Set the importedArtifacts property: The artifacts imported in the pipeline run. + * + * @param importedArtifacts the importedArtifacts value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withImportedArtifacts(List importedArtifacts) { + this.importedArtifacts = importedArtifacts; + return this; + } + + /** + * Get the progress property: The current progress of the copy operation. + * + * @return the progress value. + */ + public ProgressProperties progress() { + return this.progress; + } + + /** + * Set the progress property: The current progress of the copy operation. + * + * @param progress the progress value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withProgress(ProgressProperties progress) { + this.progress = progress; + return this; + } + + /** + * Get the startTime property: The time the pipeline run started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The time the pipeline run started. + * + * @param startTime the startTime value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the finishTime property: The time the pipeline run finished. + * + * @return the finishTime value. + */ + public OffsetDateTime finishTime() { + return this.finishTime; + } + + /** + * Set the finishTime property: The time the pipeline run finished. + * + * @param finishTime the finishTime value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withFinishTime(OffsetDateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the source property: The source of the pipeline run. + * + * @return the source value. + */ + public ImportPipelineSourceProperties source() { + return this.source; + } + + /** + * Set the source property: The source of the pipeline run. + * + * @param source the source value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withSource(ImportPipelineSourceProperties source) { + this.source = source; + return this; + } + + /** + * Get the target property: The target of the pipeline run. + * + * @return the target value. + */ + public ExportPipelineTargetProperties target() { + return this.target; + } + + /** + * Set the target property: The target of the pipeline run. + * + * @param target the target value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withTarget(ExportPipelineTargetProperties target) { + this.target = target; + return this; + } + + /** + * Get the catalogDigest property: The digest of the tar used to transfer the artifacts. + * + * @return the catalogDigest value. + */ + public String catalogDigest() { + return this.catalogDigest; + } + + /** + * Set the catalogDigest property: The digest of the tar used to transfer the artifacts. + * + * @param catalogDigest the catalogDigest value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withCatalogDigest(String catalogDigest) { + this.catalogDigest = catalogDigest; + return this; + } + + /** + * Get the trigger property: The trigger that caused the pipeline run. + * + * @return the trigger value. + */ + public PipelineTriggerDescriptor trigger() { + return this.trigger; + } + + /** + * Set the trigger property: The trigger that caused the pipeline run. + * + * @param trigger the trigger value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withTrigger(PipelineTriggerDescriptor trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the pipelineRunErrorMessage property: The detailed error message for the pipeline run in the case of failure. + * + * @return the pipelineRunErrorMessage value. + */ + public String pipelineRunErrorMessage() { + return this.pipelineRunErrorMessage; + } + + /** + * Set the pipelineRunErrorMessage property: The detailed error message for the pipeline run in the case of failure. + * + * @param pipelineRunErrorMessage the pipelineRunErrorMessage value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withPipelineRunErrorMessage(String pipelineRunErrorMessage) { + this.pipelineRunErrorMessage = pipelineRunErrorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (progress() != null) { + progress().validate(); + } + if (source() != null) { + source().validate(); + } + if (target() != null) { + target().validate(); + } + if (trigger() != null) { + trigger().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceProperties.java new file mode 100644 index 0000000000000..df92678507572 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineRunSourceProperties model. */ +@Fluent +public final class PipelineRunSourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineRunSourceProperties.class); + + /* + * The type of the source. + */ + @JsonProperty(value = "type") + private PipelineRunSourceType type; + + /* + * The name of the source. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: The type of the source. + * + * @return the type value. + */ + public PipelineRunSourceType type() { + return this.type; + } + + /** + * Set the type property: The type of the source. + * + * @param type the type value to set. + * @return the PipelineRunSourceProperties object itself. + */ + public PipelineRunSourceProperties withType(PipelineRunSourceType type) { + this.type = type; + return this; + } + + /** + * Get the name property: The name of the source. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the source. + * + * @param name the name value to set. + * @return the PipelineRunSourceProperties object itself. + */ + public PipelineRunSourceProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceType.java new file mode 100644 index 0000000000000..26a27142b404c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PipelineRunSourceType. */ +public final class PipelineRunSourceType extends ExpandableStringEnum { + /** Static value AzureStorageBlob for PipelineRunSourceType. */ + public static final PipelineRunSourceType AZURE_STORAGE_BLOB = fromString("AzureStorageBlob"); + + /** + * Creates or finds a PipelineRunSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PipelineRunSourceType. + */ + @JsonCreator + public static PipelineRunSourceType fromString(String name) { + return fromString(name, PipelineRunSourceType.class); + } + + /** @return known PipelineRunSourceType values. */ + public static Collection values() { + return values(PipelineRunSourceType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetProperties.java new file mode 100644 index 0000000000000..e43e2b06c8e3f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineRunTargetProperties model. */ +@Fluent +public final class PipelineRunTargetProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineRunTargetProperties.class); + + /* + * The type of the target. + */ + @JsonProperty(value = "type") + private PipelineRunTargetType type; + + /* + * The name of the target. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: The type of the target. + * + * @return the type value. + */ + public PipelineRunTargetType type() { + return this.type; + } + + /** + * Set the type property: The type of the target. + * + * @param type the type value to set. + * @return the PipelineRunTargetProperties object itself. + */ + public PipelineRunTargetProperties withType(PipelineRunTargetType type) { + this.type = type; + return this; + } + + /** + * Get the name property: The name of the target. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the target. + * + * @param name the name value to set. + * @return the PipelineRunTargetProperties object itself. + */ + public PipelineRunTargetProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetType.java new file mode 100644 index 0000000000000..2f3c05c342269 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PipelineRunTargetType. */ +public final class PipelineRunTargetType extends ExpandableStringEnum { + /** Static value AzureStorageBlob for PipelineRunTargetType. */ + public static final PipelineRunTargetType AZURE_STORAGE_BLOB = fromString("AzureStorageBlob"); + + /** + * Creates or finds a PipelineRunTargetType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PipelineRunTargetType. + */ + @JsonCreator + public static PipelineRunTargetType fromString(String name) { + return fromString(name, PipelineRunTargetType.class); + } + + /** @return known PipelineRunTargetType values. */ + public static Collection values() { + return values(PipelineRunTargetType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRuns.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRuns.java new file mode 100644 index 0000000000000..9be02515b9394 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRuns.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PipelineRuns. */ +public interface PipelineRuns { + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + PipelineRun get(String resourceGroupName, String registryName, String pipelineRunName); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String pipelineRunName); + + /** + * Deletes a pipeline run 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 pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Lists all the pipeline runs 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the pipeline runs 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + PipelineRun getById(String id); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a pipeline run from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a pipeline run from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PipelineRun resource. + * + * @param name resource name. + * @return the first stage of the new PipelineRun definition. + */ + PipelineRun.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerDescriptor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerDescriptor.java new file mode 100644 index 0000000000000..27d15294cc58a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerDescriptor.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The PipelineSourceTriggerDescriptor model. */ +@Fluent +public final class PipelineSourceTriggerDescriptor { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineSourceTriggerDescriptor.class); + + /* + * The timestamp when the source update happened. + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /** + * Get the timestamp property: The timestamp when the source update happened. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The timestamp when the source update happened. + * + * @param timestamp the timestamp value to set. + * @return the PipelineSourceTriggerDescriptor object itself. + */ + public PipelineSourceTriggerDescriptor withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerProperties.java new file mode 100644 index 0000000000000..0120356592374 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineSourceTriggerProperties model. */ +@Fluent +public final class PipelineSourceTriggerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineSourceTriggerProperties.class); + + /* + * The current status of the source trigger. + */ + @JsonProperty(value = "status", required = true) + private TriggerStatus status; + + /** + * Get the status property: The current status of the source trigger. + * + * @return the status value. + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of the source trigger. + * + * @param status the status value to set. + * @return the PipelineSourceTriggerProperties object itself. + */ + public PipelineSourceTriggerProperties withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model PipelineSourceTriggerProperties")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceType.java new file mode 100644 index 0000000000000..bebd638526ce8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PipelineSourceType. */ +public final class PipelineSourceType extends ExpandableStringEnum { + /** Static value AzureStorageBlobContainer for PipelineSourceType. */ + public static final PipelineSourceType AZURE_STORAGE_BLOB_CONTAINER = fromString("AzureStorageBlobContainer"); + + /** + * Creates or finds a PipelineSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PipelineSourceType. + */ + @JsonCreator + public static PipelineSourceType fromString(String name) { + return fromString(name, PipelineSourceType.class); + } + + /** @return known PipelineSourceType values. */ + public static Collection values() { + return values(PipelineSourceType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerDescriptor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerDescriptor.java new file mode 100644 index 0000000000000..c777853c0921c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerDescriptor.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineTriggerDescriptor model. */ +@Fluent +public final class PipelineTriggerDescriptor { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineTriggerDescriptor.class); + + /* + * The source trigger that caused the pipeline run. + */ + @JsonProperty(value = "sourceTrigger") + private PipelineSourceTriggerDescriptor sourceTrigger; + + /** + * Get the sourceTrigger property: The source trigger that caused the pipeline run. + * + * @return the sourceTrigger value. + */ + public PipelineSourceTriggerDescriptor sourceTrigger() { + return this.sourceTrigger; + } + + /** + * Set the sourceTrigger property: The source trigger that caused the pipeline run. + * + * @param sourceTrigger the sourceTrigger value to set. + * @return the PipelineTriggerDescriptor object itself. + */ + public PipelineTriggerDescriptor withSourceTrigger(PipelineSourceTriggerDescriptor sourceTrigger) { + this.sourceTrigger = sourceTrigger; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceTrigger() != null) { + sourceTrigger().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerProperties.java new file mode 100644 index 0000000000000..7a14f143d9d80 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineTriggerProperties model. */ +@Fluent +public final class PipelineTriggerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineTriggerProperties.class); + + /* + * The source trigger properties of the pipeline. + */ + @JsonProperty(value = "sourceTrigger") + private PipelineSourceTriggerProperties sourceTrigger; + + /** + * Get the sourceTrigger property: The source trigger properties of the pipeline. + * + * @return the sourceTrigger value. + */ + public PipelineSourceTriggerProperties sourceTrigger() { + return this.sourceTrigger; + } + + /** + * Set the sourceTrigger property: The source trigger properties of the pipeline. + * + * @param sourceTrigger the sourceTrigger value to set. + * @return the PipelineTriggerProperties object itself. + */ + public PipelineTriggerProperties withSourceTrigger(PipelineSourceTriggerProperties sourceTrigger) { + this.sourceTrigger = sourceTrigger; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceTrigger() != null) { + sourceTrigger().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PlatformProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PlatformProperties.java new file mode 100644 index 0000000000000..b85515eed0f66 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PlatformProperties.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The platform properties against which the run has to happen. */ +@Fluent +public final class PlatformProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PlatformProperties.class); + + /* + * The operating system type required for the run. + */ + @JsonProperty(value = "os", required = true) + private OS os; + + /* + * The OS architecture. + */ + @JsonProperty(value = "architecture") + private Architecture architecture; + + /* + * Variant of the CPU. + */ + @JsonProperty(value = "variant") + private Variant variant; + + /** + * Get the os property: The operating system type required for the run. + * + * @return the os value. + */ + public OS os() { + return this.os; + } + + /** + * Set the os property: The operating system type required for the run. + * + * @param os the os value to set. + * @return the PlatformProperties object itself. + */ + public PlatformProperties withOs(OS os) { + this.os = os; + return this; + } + + /** + * Get the architecture property: The OS architecture. + * + * @return the architecture value. + */ + public Architecture architecture() { + return this.architecture; + } + + /** + * Set the architecture property: The OS architecture. + * + * @param architecture the architecture value to set. + * @return the PlatformProperties object itself. + */ + public PlatformProperties withArchitecture(Architecture architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get the variant property: Variant of the CPU. + * + * @return the variant value. + */ + public Variant variant() { + return this.variant; + } + + /** + * Set the variant property: Variant of the CPU. + * + * @param variant the variant value to set. + * @return the PlatformProperties object itself. + */ + public PlatformProperties withVariant(Variant variant) { + this.variant = variant; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (os() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property os in model PlatformProperties")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PlatformUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PlatformUpdateParameters.java new file mode 100644 index 0000000000000..65a2e27166d6e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PlatformUpdateParameters.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties for updating the platform configuration. */ +@Fluent +public final class PlatformUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PlatformUpdateParameters.class); + + /* + * The operating system type required for the run. + */ + @JsonProperty(value = "os") + private OS os; + + /* + * The OS architecture. + */ + @JsonProperty(value = "architecture") + private Architecture architecture; + + /* + * Variant of the CPU. + */ + @JsonProperty(value = "variant") + private Variant variant; + + /** + * Get the os property: The operating system type required for the run. + * + * @return the os value. + */ + public OS os() { + return this.os; + } + + /** + * Set the os property: The operating system type required for the run. + * + * @param os the os value to set. + * @return the PlatformUpdateParameters object itself. + */ + public PlatformUpdateParameters withOs(OS os) { + this.os = os; + return this; + } + + /** + * Get the architecture property: The OS architecture. + * + * @return the architecture value. + */ + public Architecture architecture() { + return this.architecture; + } + + /** + * Set the architecture property: The OS architecture. + * + * @param architecture the architecture value to set. + * @return the PlatformUpdateParameters object itself. + */ + public PlatformUpdateParameters withArchitecture(Architecture architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get the variant property: Variant of the CPU. + * + * @return the variant value. + */ + public Variant variant() { + return this.variant; + } + + /** + * Set the variant property: Variant of the CPU. + * + * @param variant the variant value to set. + * @return the PlatformUpdateParameters object itself. + */ + public PlatformUpdateParameters withVariant(Variant variant) { + this.variant = variant; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Policies.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Policies.java new file mode 100644 index 0000000000000..864d4b318afcf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Policies.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The policies for a container registry. */ +@Fluent +public final class Policies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Policies.class); + + /* + * The quarantine policy for a container registry. + */ + @JsonProperty(value = "quarantinePolicy") + private QuarantinePolicy quarantinePolicy; + + /* + * The content trust policy for a container registry. + */ + @JsonProperty(value = "trustPolicy") + private TrustPolicy trustPolicy; + + /* + * The retention policy for a container registry. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /* + * The export policy for a container registry. + */ + @JsonProperty(value = "exportPolicy") + private ExportPolicy exportPolicy; + + /** + * Get the quarantinePolicy property: The quarantine policy for a container registry. + * + * @return the quarantinePolicy value. + */ + public QuarantinePolicy quarantinePolicy() { + return this.quarantinePolicy; + } + + /** + * Set the quarantinePolicy property: The quarantine policy for a container registry. + * + * @param quarantinePolicy the quarantinePolicy value to set. + * @return the Policies object itself. + */ + public Policies withQuarantinePolicy(QuarantinePolicy quarantinePolicy) { + this.quarantinePolicy = quarantinePolicy; + return this; + } + + /** + * Get the trustPolicy property: The content trust policy for a container registry. + * + * @return the trustPolicy value. + */ + public TrustPolicy trustPolicy() { + return this.trustPolicy; + } + + /** + * Set the trustPolicy property: The content trust policy for a container registry. + * + * @param trustPolicy the trustPolicy value to set. + * @return the Policies object itself. + */ + public Policies withTrustPolicy(TrustPolicy trustPolicy) { + this.trustPolicy = trustPolicy; + return this; + } + + /** + * Get the retentionPolicy property: The retention policy for a container registry. + * + * @return the retentionPolicy value. + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy property: The retention policy for a container registry. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the Policies object itself. + */ + public Policies withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get the exportPolicy property: The export policy for a container registry. + * + * @return the exportPolicy value. + */ + public ExportPolicy exportPolicy() { + return this.exportPolicy; + } + + /** + * Set the exportPolicy property: The export policy for a container registry. + * + * @param exportPolicy the exportPolicy value to set. + * @return the Policies object itself. + */ + public Policies withExportPolicy(ExportPolicy exportPolicy) { + this.exportPolicy = exportPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (quarantinePolicy() != null) { + quarantinePolicy().validate(); + } + if (trustPolicy() != null) { + trustPolicy().validate(); + } + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + if (exportPolicy() != null) { + exportPolicy().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PolicyStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PolicyStatus.java new file mode 100644 index 0000000000000..42a918cb8ff16 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PolicyStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyStatus. */ +public final class PolicyStatus extends ExpandableStringEnum { + /** Static value enabled for PolicyStatus. */ + public static final PolicyStatus ENABLED = fromString("enabled"); + + /** Static value disabled for PolicyStatus. */ + public static final PolicyStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a PolicyStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyStatus. + */ + @JsonCreator + public static PolicyStatus fromString(String name) { + return fromString(name, PolicyStatus.class); + } + + /** @return known PolicyStatus values. */ + public static Collection values() { + return values(PolicyStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpoint.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..b042662a0f159 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpoint.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Fluent +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * This is private endpoint resource created with Microsoft.Network + * resource provider. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: This is private endpoint resource created with Microsoft.Network resource provider. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: This is private endpoint resource created with Microsoft.Network resource provider. + * + * @param id the id value to set. + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnection.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..ad239b2b784cc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of private endpoint connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private endpoint.. + * + * @param privateEndpoint The resource of private endpoint. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private endpoint.. + * + * @param privateEndpoint The resource of private endpoint. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnectionListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..9632a7c98f8f4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list private endpoint connections for a container registry. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * The list of private endpoint connections. Since this list may be + * incomplete, the nextLink field should be used to request the next list + * of private endpoint connections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of private endpoint + * connections. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of private endpoint connections. Since this list may be incomplete, the nextLink + * field should be used to request the next list of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of private endpoint connections. Since this list may be incomplete, the nextLink + * field should be used to request the next list of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of private endpoint connections. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of private endpoint connections. + * + * @param nextLink the nextLink value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnections.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..f9f9783c40b2f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnections.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + PrivateEndpointConnection get(String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + PrivateEndpointConnection getById(String id); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResource.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..654c38022a67b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResource.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the type property: The resource type is private link resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the id property: The resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResourceListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..45ff461b70a7a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResourceListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list private link resources for a container registry. */ +@Fluent +public final class PrivateLinkResourceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResult.class); + + /* + * The list of private link resources. Since this list may be incomplete, + * the nextLink field should be used to request the next list of private + * link resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of private link + * resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of private link resources. Since this list may be incomplete, the nextLink field + * should be used to request the next list of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of private link resources. Since this list may be incomplete, the nextLink field + * should be used to request the next list of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of private link resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of private link resources. + * + * @param nextLink the nextLink value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkServiceConnectionState.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..722d9d3dfaa3e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The state of a private link service connection. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * The private link service connection status. + */ + @JsonProperty(value = "status") + private ConnectionStatus status; + + /* + * The description for connection status. For example if connection is + * rejected it can indicate reason for rejection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private ActionsRequired actionsRequired; + + /** + * Get the status property: The private link service connection status. + * + * @return the status value. + */ + public ConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: The private link service connection status. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(ConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The description for connection status. For example if connection is rejected it can + * indicate reason for rejection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description for connection status. For example if connection is rejected it can + * indicate reason for rejection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public ActionsRequired actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(ActionsRequired actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProgressProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProgressProperties.java new file mode 100644 index 0000000000000..19126b39bf919 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProgressProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ProgressProperties model. */ +@Fluent +public final class ProgressProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProgressProperties.class); + + /* + * The percentage complete of the copy operation. + */ + @JsonProperty(value = "percentage") + private String percentage; + + /** + * Get the percentage property: The percentage complete of the copy operation. + * + * @return the percentage value. + */ + public String percentage() { + return this.percentage; + } + + /** + * Set the percentage property: The percentage complete of the copy operation. + * + * @param percentage the percentage value to set. + * @return the ProgressProperties object itself. + */ + public ProgressProperties withPercentage(String percentage) { + this.percentage = percentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProvisioningState.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..ca319030c5991 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProvisioningState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PublicNetworkAccess.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..09242c9e00834 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PublicNetworkAccess.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccess. */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** @return known PublicNetworkAccess values. */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/QuarantinePolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/QuarantinePolicy.java new file mode 100644 index 0000000000000..ba2473ae8025c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/QuarantinePolicy.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The quarantine policy for a container registry. */ +@Fluent +public final class QuarantinePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuarantinePolicy.class); + + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The value that indicates whether the policy is enabled or not. + * + * @param status the status value to set. + * @return the QuarantinePolicy object itself. + */ + public QuarantinePolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegenerateCredentialParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegenerateCredentialParameters.java new file mode 100644 index 0000000000000..707d4274c7320 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegenerateCredentialParameters.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used to regenerate the login credential. */ +@Fluent +public final class RegenerateCredentialParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenerateCredentialParameters.class); + + /* + * Specifies name of the password which should be regenerated -- password + * or password2. + */ + @JsonProperty(value = "name", required = true) + private PasswordName name; + + /** + * Get the name property: Specifies name of the password which should be regenerated -- password or password2. + * + * @return the name value. + */ + public PasswordName name() { + return this.name; + } + + /** + * Set the name property: Specifies name of the password which should be regenerated -- password or password2. + * + * @param name the name value to set. + * @return the RegenerateCredentialParameters object itself. + */ + public RegenerateCredentialParameters withName(PasswordName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model RegenerateCredentialParameters")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registries.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registries.java new file mode 100644 index 0000000000000..9b8465542b6d6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registries.java @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Registries. */ +public interface Registries { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters, Context context); + + /** + * 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 registryNameCheckRequest The object containing information for the availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + RegistryNameStatus checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest); + + /** + * 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 registryNameCheckRequest The object containing information for the availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + Registry getByResourceGroup(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String registryName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the container registries under the specified subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + PagedIterable list(); + + /** + * Lists all the container registries under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries. + */ + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + RegistryListCredentialsResult listCredentials(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * 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 regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + RegistryListCredentialsResult regenerateCredential( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters); + + /** + * 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 regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + RegistryUsageListResult listUsages(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + PagedIterable listPrivateLinkResources(String resourceGroupName, String registryName); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry. + */ + PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + GenerateCredentialsResult generateCredentials( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + GenerateCredentialsResult generateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + Run scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + Run scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + SourceUploadDefinition getBuildSourceUploadUrl(String resourceGroupName, String registryName); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + Response getBuildSourceUploadUrlWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + Registry getById(String id); + + /** + * Gets the properties of the specified container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Registry resource. + * + * @param name resource name. + * @return the first stage of the new Registry definition. + */ + Registry.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registry.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registry.java new file mode 100644 index 0000000000000..1c339fedd25f9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registry.java @@ -0,0 +1,700 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Registry. */ +public interface Registry { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The SKU of the container registry. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the identity property: The identity of the container registry. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the loginServer property: The URL that can be used to log into the container registry. + * + * @return the loginServer value. + */ + String loginServer(); + + /** + * Gets the creationDate property: The creation date of the container registry in ISO8601 format. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: The provisioning state of the container registry at the time the operation + * was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the status property: The status of the container registry at the time the operation was called. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value. + */ + Boolean adminUserEnabled(); + + /** + * Gets the networkRuleSet property: The network rule set for a container registry. + * + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * Gets the policies property: The policies for a container registry. + * + * @return the policies value. + */ + Policies policies(); + + /** + * Gets the encryption property: The encryption settings of container registry. + * + * @return the encryption value. + */ + EncryptionProperty encryption(); + + /** + * Gets the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @return the dataEndpointEnabled value. + */ + Boolean dataEndpointEnabled(); + + /** + * Gets the dataEndpointHostNames property: List of host names that will serve data when dataEndpointEnabled is + * true. + * + * @return the dataEndpointHostNames value. + */ + List dataEndpointHostNames(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connections for a container registry. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the publicNetworkAccess property: Whether or not public network access is allowed for the container + * registry. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network + * restricted registry. + * + * @return the networkRuleBypassOptions value. + */ + NetworkRuleBypassOptions networkRuleBypassOptions(); + + /** + * Gets the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry. + * + * @return the zoneRedundancy value. + */ + ZoneRedundancy zoneRedundancy(); + + /** + * Gets the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @return the anonymousPullEnabled value. + */ + Boolean anonymousPullEnabled(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner object. + * + * @return the inner object. + */ + RegistryInner innerModel(); + + /** The entirety of the Registry definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The Registry definition stages. */ + interface DefinitionStages { + /** The first stage of the Registry definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Registry definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Registry definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Registry definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the container registry.. + * + * @param sku The SKU of the container registry. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the Registry definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithAdminUserEnabled, + DefinitionStages.WithNetworkRuleSet, + DefinitionStages.WithPolicies, + DefinitionStages.WithEncryption, + DefinitionStages.WithDataEndpointEnabled, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithNetworkRuleBypassOptions, + DefinitionStages.WithZoneRedundancy, + DefinitionStages.WithAnonymousPullEnabled { + /** + * Executes the create request. + * + * @return the created resource. + */ + Registry create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Registry create(Context context); + } + /** The stage of the Registry definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Registry definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the container registry.. + * + * @param identity The identity of the container registry. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + /** The stage of the Registry definition allowing to specify adminUserEnabled. */ + interface WithAdminUserEnabled { + /** + * Specifies the adminUserEnabled property: The value that indicates whether the admin user is enabled.. + * + * @param adminUserEnabled The value that indicates whether the admin user is enabled. + * @return the next definition stage. + */ + WithCreate withAdminUserEnabled(Boolean adminUserEnabled); + } + /** The stage of the Registry definition allowing to specify networkRuleSet. */ + interface WithNetworkRuleSet { + /** + * Specifies the networkRuleSet property: The network rule set for a container registry.. + * + * @param networkRuleSet The network rule set for a container registry. + * @return the next definition stage. + */ + WithCreate withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + /** The stage of the Registry definition allowing to specify policies. */ + interface WithPolicies { + /** + * Specifies the policies property: The policies for a container registry.. + * + * @param policies The policies for a container registry. + * @return the next definition stage. + */ + WithCreate withPolicies(Policies policies); + } + /** The stage of the Registry definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption settings of container registry.. + * + * @param encryption The encryption settings of container registry. + * @return the next definition stage. + */ + WithCreate withEncryption(EncryptionProperty encryption); + } + /** The stage of the Registry definition allowing to specify dataEndpointEnabled. */ + interface WithDataEndpointEnabled { + /** + * Specifies the dataEndpointEnabled property: Enable a single data endpoint per region for serving data.. + * + * @param dataEndpointEnabled Enable a single data endpoint per region for serving data. + * @return the next definition stage. + */ + WithCreate withDataEndpointEnabled(Boolean dataEndpointEnabled); + } + /** The stage of the Registry definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Whether or not public network access is allowed for the + * container registry.. + * + * @param publicNetworkAccess Whether or not public network access is allowed for the container registry. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Registry definition allowing to specify networkRuleBypassOptions. */ + interface WithNetworkRuleBypassOptions { + /** + * Specifies the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a + * network restricted registry.. + * + * @param networkRuleBypassOptions Whether to allow trusted Azure services to access a network restricted + * registry. + * @return the next definition stage. + */ + WithCreate withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions); + } + /** The stage of the Registry definition allowing to specify zoneRedundancy. */ + interface WithZoneRedundancy { + /** + * Specifies the zoneRedundancy property: Whether or not zone redundancy is enabled for this container + * registry. + * + * @param zoneRedundancy Whether or not zone redundancy is enabled for this container registry. + * @return the next definition stage. + */ + WithCreate withZoneRedundancy(ZoneRedundancy zoneRedundancy); + } + /** The stage of the Registry definition allowing to specify anonymousPullEnabled. */ + interface WithAnonymousPullEnabled { + /** + * Specifies the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients.. + * + * @param anonymousPullEnabled Enables registry-wide pull from unauthenticated clients. + * @return the next definition stage. + */ + WithCreate withAnonymousPullEnabled(Boolean anonymousPullEnabled); + } + } + /** + * Begins update for the Registry resource. + * + * @return the stage of resource update. + */ + Registry.Update update(); + + /** The template for Registry update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithSku, + UpdateStages.WithAdminUserEnabled, + UpdateStages.WithNetworkRuleSet, + UpdateStages.WithPolicies, + UpdateStages.WithEncryption, + UpdateStages.WithDataEndpointEnabled, + UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithNetworkRuleBypassOptions, + UpdateStages.WithAnonymousPullEnabled { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Registry apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Registry apply(Context context); + } + /** The Registry update stages. */ + interface UpdateStages { + /** The stage of the Registry update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags for the container registry.. + * + * @param tags The tags for the container registry. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Registry update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the container registry.. + * + * @param identity The identity of the container registry. + * @return the next definition stage. + */ + Update withIdentity(IdentityProperties identity); + } + /** The stage of the Registry update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the container registry.. + * + * @param sku The SKU of the container registry. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the Registry update allowing to specify adminUserEnabled. */ + interface WithAdminUserEnabled { + /** + * Specifies the adminUserEnabled property: The value that indicates whether the admin user is enabled.. + * + * @param adminUserEnabled The value that indicates whether the admin user is enabled. + * @return the next definition stage. + */ + Update withAdminUserEnabled(Boolean adminUserEnabled); + } + /** The stage of the Registry update allowing to specify networkRuleSet. */ + interface WithNetworkRuleSet { + /** + * Specifies the networkRuleSet property: The network rule set for a container registry.. + * + * @param networkRuleSet The network rule set for a container registry. + * @return the next definition stage. + */ + Update withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + /** The stage of the Registry update allowing to specify policies. */ + interface WithPolicies { + /** + * Specifies the policies property: The policies for a container registry.. + * + * @param policies The policies for a container registry. + * @return the next definition stage. + */ + Update withPolicies(Policies policies); + } + /** The stage of the Registry update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption settings of container registry.. + * + * @param encryption The encryption settings of container registry. + * @return the next definition stage. + */ + Update withEncryption(EncryptionProperty encryption); + } + /** The stage of the Registry update allowing to specify dataEndpointEnabled. */ + interface WithDataEndpointEnabled { + /** + * Specifies the dataEndpointEnabled property: Enable a single data endpoint per region for serving data.. + * + * @param dataEndpointEnabled Enable a single data endpoint per region for serving data. + * @return the next definition stage. + */ + Update withDataEndpointEnabled(Boolean dataEndpointEnabled); + } + /** The stage of the Registry update allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Whether or not public network access is allowed for the + * container registry.. + * + * @param publicNetworkAccess Whether or not public network access is allowed for the container registry. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Registry update allowing to specify networkRuleBypassOptions. */ + interface WithNetworkRuleBypassOptions { + /** + * Specifies the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a + * network restricted registry.. + * + * @param networkRuleBypassOptions Whether to allow trusted Azure services to access a network restricted + * registry. + * @return the next definition stage. + */ + Update withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions); + } + /** The stage of the Registry update allowing to specify anonymousPullEnabled. */ + interface WithAnonymousPullEnabled { + /** + * Specifies the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients.. + * + * @param anonymousPullEnabled Enables registry-wide pull from unauthenticated clients. + * @return the next definition stage. + */ + Update withAnonymousPullEnabled(Boolean anonymousPullEnabled); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Registry refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Registry refresh(Context context); + + /** + * Copies an image to this container registry from the specified 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importImage(ImportImageParameters parameters); + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importImage(ImportImageParameters parameters, Context context); + + /** + * Lists the login credentials for the specified container registry. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + RegistryListCredentialsResult listCredentials(); + + /** + * Lists the login credentials for the specified container registry. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + Response listCredentialsWithResponse(Context context); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + RegistryListCredentialsResult regenerateCredential(RegenerateCredentialParameters regenerateCredentialParameters); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + Response regenerateCredentialWithResponse( + RegenerateCredentialParameters regenerateCredentialParameters, Context context); + + /** + * Generate keys for a token of a specified container registry. + * + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + GenerateCredentialsResult generateCredentials(GenerateCredentialsParameters generateCredentialsParameters); + + /** + * Generate keys for a token of a specified container registry. + * + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + GenerateCredentialsResult generateCredentials( + GenerateCredentialsParameters generateCredentialsParameters, Context context); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + Run scheduleRun(RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + Run scheduleRun(RunRequest runRequest, Context context); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + SourceUploadDefinition getBuildSourceUploadUrl(); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + Response getBuildSourceUploadUrlWithResponse(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListCredentialsResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListCredentialsResult.java new file mode 100644 index 0000000000000..cda334babe262 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListCredentialsResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner; +import java.util.List; + +/** An immutable client-side representation of RegistryListCredentialsResult. */ +public interface RegistryListCredentialsResult { + /** + * Gets the username property: The username for a container registry. + * + * @return the username value. + */ + String username(); + + /** + * Gets the passwords property: The list of passwords for a container registry. + * + * @return the passwords value. + */ + List passwords(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner object. + * + * @return the inner object. + */ + RegistryListCredentialsResultInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListResult.java new file mode 100644 index 0000000000000..db5ff2984d286 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list container registries. */ +@Fluent +public final class RegistryListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryListResult.class); + + /* + * The list of container registries. Since this list may be incomplete, the + * nextLink field should be used to request the next list of container + * registries. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of container + * registries. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of container registries. Since this list may be incomplete, the nextLink field + * should be used to request the next list of container registries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of container registries. Since this list may be incomplete, the nextLink field + * should be used to request the next list of container registries. + * + * @param value the value value to set. + * @return the RegistryListResult object itself. + */ + public RegistryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of container registries. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of container registries. + * + * @param nextLink the nextLink value to set. + * @return the RegistryListResult object itself. + */ + public RegistryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameCheckRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameCheckRequest.java new file mode 100644 index 0000000000000..da21973f62a60 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameCheckRequest.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A request to check whether a container registry name is available. */ +@Fluent +public final class RegistryNameCheckRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryNameCheckRequest.class); + + /* + * 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. */ + public RegistryNameCheckRequest() { + type = "Microsoft.ContainerRegistry/registries"; + } + + /** + * Get the name property: The name of the container registry. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 type property: 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 type property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model RegistryNameCheckRequest")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameStatus.java new file mode 100644 index 0000000000000..81b95497f6e70 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner; + +/** An immutable client-side representation of RegistryNameStatus. */ +public interface RegistryNameStatus { + /** + * Gets the nameAvailable property: The value that indicates whether the name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: If any, the reason that the name is not available. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: If any, the error message that provides more detail for the reason that the name is + * not available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner + * object. + * + * @return the inner object. + */ + RegistryNameStatusInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryPassword.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryPassword.java new file mode 100644 index 0000000000000..18c568559e069 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryPassword.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The login password for the container registry. */ +@Fluent +public final class RegistryPassword { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryPassword.class); + + /* + * The password name. + */ + @JsonProperty(value = "name") + private PasswordName name; + + /* + * The password value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: The password name. + * + * @return the name value. + */ + public PasswordName name() { + return this.name; + } + + /** + * Set the name property: The password name. + * + * @param name the name value to set. + * @return the RegistryPassword object itself. + */ + public RegistryPassword withName(PasswordName name) { + this.name = name; + return this; + } + + /** + * Get the value property: The password value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUpdateParameters.java new file mode 100644 index 0000000000000..238e77fd03aaa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUpdateParameters.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a container registry. */ +@JsonFlatten +@Fluent +public class RegistryUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryUpdateParameters.class); + + /* + * The identity of the container registry. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * 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 network rule set for a container registry. + */ + @JsonProperty(value = "properties.networkRuleSet") + private NetworkRuleSet networkRuleSet; + + /* + * The policies for a container registry. + */ + @JsonProperty(value = "properties.policies") + private Policies policies; + + /* + * The encryption settings of container registry. + */ + @JsonProperty(value = "properties.encryption") + private EncryptionProperty encryption; + + /* + * Enable a single data endpoint per region for serving data. + */ + @JsonProperty(value = "properties.dataEndpointEnabled") + private Boolean dataEndpointEnabled; + + /* + * Whether or not public network access is allowed for the container + * registry. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Whether to allow trusted Azure services to access a network restricted + * registry. + */ + @JsonProperty(value = "properties.networkRuleBypassOptions") + private NetworkRuleBypassOptions networkRuleBypassOptions; + + /* + * Enables registry-wide pull from unauthenticated clients. + */ + @JsonProperty(value = "properties.anonymousPullEnabled") + private Boolean anonymousPullEnabled; + + /** + * Get the identity property: The identity of the container registry. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the container registry. + * + * @param identity the identity value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the tags property: The tags for the container registry. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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 property: The SKU of the container registry. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: 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 adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value. + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the adminUserEnabled property: 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 networkRuleSet property: The network rule set for a container registry. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set the networkRuleSet property: The network rule set for a container registry. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the policies property: The policies for a container registry. + * + * @return the policies value. + */ + public Policies policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for a container registry. + * + * @param policies the policies value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withPolicies(Policies policies) { + this.policies = policies; + return this; + } + + /** + * Get the encryption property: The encryption settings of container registry. + * + * @return the encryption value. + */ + public EncryptionProperty encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption settings of container registry. + * + * @param encryption the encryption value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withEncryption(EncryptionProperty encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @return the dataEndpointEnabled value. + */ + public Boolean dataEndpointEnabled() { + return this.dataEndpointEnabled; + } + + /** + * Set the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @param dataEndpointEnabled the dataEndpointEnabled value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withDataEndpointEnabled(Boolean dataEndpointEnabled) { + this.dataEndpointEnabled = dataEndpointEnabled; + return this; + } + + /** + * Get the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @return the networkRuleBypassOptions value. + */ + public NetworkRuleBypassOptions networkRuleBypassOptions() { + return this.networkRuleBypassOptions; + } + + /** + * Set the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @param networkRuleBypassOptions the networkRuleBypassOptions value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions) { + this.networkRuleBypassOptions = networkRuleBypassOptions; + return this; + } + + /** + * Get the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @return the anonymousPullEnabled value. + */ + public Boolean anonymousPullEnabled() { + return this.anonymousPullEnabled; + } + + /** + * Set the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @param anonymousPullEnabled the anonymousPullEnabled value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withAnonymousPullEnabled(Boolean anonymousPullEnabled) { + this.anonymousPullEnabled = anonymousPullEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (networkRuleSet() != null) { + networkRuleSet().validate(); + } + if (policies() != null) { + policies().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsage.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsage.java new file mode 100644 index 0000000000000..c6460dd300ddb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsage.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The quota usage for a container registry. */ +@Fluent +public final class RegistryUsage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryUsage.class); + + /* + * 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. + */ + @JsonProperty(value = "unit") + private RegistryUsageUnit unit; + + /** + * Get the name property: The name of the usage. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 property: The limit of the usage. + * + * @return the limit value. + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit property: 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 currentValue property: The current value of the usage. + * + * @return the currentValue value. + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: 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 property: The unit of measurement. + * + * @return the unit value. + */ + public RegistryUsageUnit unit() { + return this.unit; + } + + /** + * Set the unit property: The unit of measurement. + * + * @param unit the unit value to set. + * @return the RegistryUsage object itself. + */ + public RegistryUsage withUnit(RegistryUsageUnit unit) { + this.unit = unit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageListResult.java new file mode 100644 index 0000000000000..a32700d1b5dfe --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner; +import java.util.List; + +/** An immutable client-side representation of RegistryUsageListResult. */ +public interface RegistryUsageListResult { + /** + * Gets the value property: The list of container registry quota usages. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner + * object. + * + * @return the inner object. + */ + RegistryUsageListResultInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageUnit.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageUnit.java new file mode 100644 index 0000000000000..84f65fb1b1178 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageUnit.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RegistryUsageUnit. */ +public final class RegistryUsageUnit extends ExpandableStringEnum { + /** Static value Count for RegistryUsageUnit. */ + public static final RegistryUsageUnit COUNT = fromString("Count"); + + /** Static value Bytes for RegistryUsageUnit. */ + public static final RegistryUsageUnit BYTES = fromString("Bytes"); + + /** + * Creates or finds a RegistryUsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding RegistryUsageUnit. + */ + @JsonCreator + public static RegistryUsageUnit fromString(String name) { + return fromString(name, RegistryUsageUnit.class); + } + + /** @return known RegistryUsageUnit values. */ + public static Collection values() { + return values(RegistryUsageUnit.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replication.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replication.java new file mode 100644 index 0000000000000..68d5fcdfae635 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replication.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import java.util.Map; + +/** An immutable client-side representation of Replication. */ +public interface Replication { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the replication at the time the operation was + * called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the status property: The status of the replication at the time the operation was called. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @return the regionEndpointEnabled value. + */ + Boolean regionEndpointEnabled(); + + /** + * Gets the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry + * replication. + * + * @return the zoneRedundancy value. + */ + ZoneRedundancy zoneRedundancy(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner object. + * + * @return the inner object. + */ + ReplicationInner innerModel(); + + /** The entirety of the Replication definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Replication definition stages. */ + interface DefinitionStages { + /** The first stage of the Replication definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Replication definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Replication definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the Replication definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithRegionEndpointEnabled, + DefinitionStages.WithZoneRedundancy { + /** + * Executes the create request. + * + * @return the created resource. + */ + Replication create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Replication create(Context context); + } + /** The stage of the Replication definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Replication definition allowing to specify regionEndpointEnabled. */ + interface WithRegionEndpointEnabled { + /** + * Specifies the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is + * enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its + * data will continue to be synced with other replications.. + * + * @param regionEndpointEnabled Specifies whether the replication's regional endpoint is enabled. Requests + * will not be routed to a replication whose regional endpoint is disabled, however its data will + * continue to be synced with other replications. + * @return the next definition stage. + */ + WithCreate withRegionEndpointEnabled(Boolean regionEndpointEnabled); + } + /** The stage of the Replication definition allowing to specify zoneRedundancy. */ + interface WithZoneRedundancy { + /** + * Specifies the zoneRedundancy property: Whether or not zone redundancy is enabled for this container + * registry replication. + * + * @param zoneRedundancy Whether or not zone redundancy is enabled for this container registry replication. + * @return the next definition stage. + */ + WithCreate withZoneRedundancy(ZoneRedundancy zoneRedundancy); + } + } + /** + * Begins update for the Replication resource. + * + * @return the stage of resource update. + */ + Replication.Update update(); + + /** The template for Replication update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithRegionEndpointEnabled { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Replication apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Replication apply(Context context); + } + /** The Replication update stages. */ + interface UpdateStages { + /** The stage of the Replication update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags for the replication.. + * + * @param tags The tags for the replication. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Replication update allowing to specify regionEndpointEnabled. */ + interface WithRegionEndpointEnabled { + /** + * Specifies the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is + * enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its + * data will continue to be synced with other replications.. + * + * @param regionEndpointEnabled Specifies whether the replication's regional endpoint is enabled. Requests + * will not be routed to a replication whose regional endpoint is disabled, however its data will + * continue to be synced with other replications. + * @return the next definition stage. + */ + Update withRegionEndpointEnabled(Boolean regionEndpointEnabled); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Replication refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Replication refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationListResult.java new file mode 100644 index 0000000000000..98f4556a33c27 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list replications for a container registry. */ +@Fluent +public final class ReplicationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationListResult.class); + + /* + * The list of replications. Since this list may be incomplete, the + * nextLink field should be used to request the next list of replications. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of replications. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of replications. Since this list may be incomplete, the nextLink field should be + * used to request the next list of replications. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of replications. Since this list may be incomplete, the nextLink field should be + * used to request the next list of replications. + * + * @param value the value value to set. + * @return the ReplicationListResult object itself. + */ + public ReplicationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of replications. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of replications. + * + * @param nextLink the nextLink value to set. + * @return the ReplicationListResult object itself. + */ + public ReplicationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationUpdateParameters.java new file mode 100644 index 0000000000000..f6749194b90ab --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationUpdateParameters.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a replication. */ +@JsonFlatten +@Fluent +public class ReplicationUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationUpdateParameters.class); + + /* + * The tags for the replication. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is + * disabled, however its data will continue to be synced with other + * replications. + */ + @JsonProperty(value = "properties.regionEndpointEnabled") + private Boolean regionEndpointEnabled; + + /** + * Get the tags property: The tags for the replication. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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; + } + + /** + * Get the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @return the regionEndpointEnabled value. + */ + public Boolean regionEndpointEnabled() { + return this.regionEndpointEnabled; + } + + /** + * Set the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @param regionEndpointEnabled the regionEndpointEnabled value to set. + * @return the ReplicationUpdateParameters object itself. + */ + public ReplicationUpdateParameters withRegionEndpointEnabled(Boolean regionEndpointEnabled) { + this.regionEndpointEnabled = regionEndpointEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replications.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replications.java new file mode 100644 index 0000000000000..1151229fc5a34 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replications.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Replications. */ +public interface Replications { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + Replication get(String resourceGroupName, String registryName, String replicationName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String replicationName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified replication. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + Replication getById(String id); + + /** + * Gets the properties of the specified replication. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a replication from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a replication from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Replication resource. + * + * @param name resource name. + * @return the first stage of the new Replication definition. + */ + Replication.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Request.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Request.java new file mode 100644 index 0000000000000..9335c61e99751 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Request.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The request that generated the event. */ +@Fluent +public final class Request { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Request.class); + + /* + * 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 property: The ID of the request that initiated the event. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: 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 addr property: 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 addr property: 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 host property: 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 host property: 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 method property: The request method that generated the event. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: 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 useragent property: The user agent header of the request. + * + * @return the useragent value. + */ + public String useragent() { + return this.useragent; + } + + /** + * Set the useragent property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ResourceIdentityType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..104dc6da087b6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ResourceIdentityType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RetentionPolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RetentionPolicy.java new file mode 100644 index 0000000000000..8afd637b62513 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RetentionPolicy.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The retention policy for a container registry. */ +@Fluent +public final class RetentionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RetentionPolicy.class); + + /* + * The number of days to retain an untagged manifest after which it gets + * purged. + */ + @JsonProperty(value = "days") + private Integer days; + + /* + * The timestamp when the policy was last updated. + */ + @JsonProperty(value = "lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTime; + + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the days property: The number of days to retain an untagged manifest after which it gets purged. + * + * @return the days value. + */ + public Integer days() { + return this.days; + } + + /** + * Set the days property: The number of days to retain an untagged manifest after which it gets purged. + * + * @param days the days value to set. + * @return the RetentionPolicy object itself. + */ + public RetentionPolicy withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get the lastUpdatedTime property: The timestamp when the policy was last updated. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The value that indicates whether the policy is enabled or not. + * + * @param status the status value to set. + * @return the RetentionPolicy object itself. + */ + public RetentionPolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Run.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Run.java new file mode 100644 index 0000000000000..6f0c4200747da --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Run.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Run. */ +public interface Run { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the runId property: The unique identifier for the run. + * + * @return the runId value. + */ + String runId(); + + /** + * Gets the status property: The current status of the run. + * + * @return the status value. + */ + RunStatus status(); + + /** + * Gets the lastUpdatedTime property: The last updated time for the run. + * + * @return the lastUpdatedTime value. + */ + OffsetDateTime lastUpdatedTime(); + + /** + * Gets the runType property: The type of run. + * + * @return the runType value. + */ + RunType runType(); + + /** + * Gets the agentPoolName property: The dedicated agent pool for the run. + * + * @return the agentPoolName value. + */ + String agentPoolName(); + + /** + * Gets the createTime property: The time the run was scheduled. + * + * @return the createTime value. + */ + OffsetDateTime createTime(); + + /** + * Gets the startTime property: The time the run started. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the finishTime property: The time the run finished. + * + * @return the finishTime value. + */ + OffsetDateTime finishTime(); + + /** + * Gets the outputImages property: The list of all images that were generated from the run. This is applicable if + * the run generates base image dependencies. + * + * @return the outputImages value. + */ + List outputImages(); + + /** + * Gets the task property: The task against which run was scheduled. + * + * @return the task value. + */ + String task(); + + /** + * Gets the imageUpdateTrigger property: The image update trigger that caused the run. This is applicable if the + * task has base image trigger configured. + * + * @return the imageUpdateTrigger value. + */ + ImageUpdateTrigger imageUpdateTrigger(); + + /** + * Gets the sourceTrigger property: The source trigger that caused the run. + * + * @return the sourceTrigger value. + */ + SourceTriggerDescriptor sourceTrigger(); + + /** + * Gets the timerTrigger property: The timer trigger that caused the run. + * + * @return the timerTrigger value. + */ + TimerTriggerDescriptor timerTrigger(); + + /** + * Gets the platform property: The platform properties against which the run will happen. + * + * @return the platform value. + */ + PlatformProperties platform(); + + /** + * Gets the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + AgentProperties agentConfiguration(); + + /** + * Gets the sourceRegistryAuth property: The scope of the credentials that were used to login to the source registry + * during this run. + * + * @return the sourceRegistryAuth value. + */ + String sourceRegistryAuth(); + + /** + * Gets the customRegistries property: The list of custom registries that were logged in during this run. + * + * @return the customRegistries value. + */ + List customRegistries(); + + /** + * Gets the runErrorMessage property: The error message received from backend systems after the run is scheduled. + * + * @return the runErrorMessage value. + */ + String runErrorMessage(); + + /** + * Gets the updateTriggerToken property: The update trigger token passed for the Run. + * + * @return the updateTriggerToken value. + */ + String updateTriggerToken(); + + /** + * Gets the logArtifact property: The image description for the log artifact. + * + * @return the logArtifact value. + */ + ImageDescriptor logArtifact(); + + /** + * Gets the provisioningState property: The provisioning state of a run. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value. + */ + Boolean isArchiveEnabled(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner object. + * + * @return the inner object. + */ + RunInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunGetLogResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunGetLogResult.java new file mode 100644 index 0000000000000..757e3896f4d67 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunGetLogResult.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunGetLogResultInner; + +/** An immutable client-side representation of RunGetLogResult. */ +public interface RunGetLogResult { + /** + * Gets the logLink property: The link to logs for a run on a azure container registry. + * + * @return the logLink value. + */ + String logLink(); + + /** + * Gets the logArtifactLink property: The link to logs in registry for a run on a azure container registry. + * + * @return the logArtifactLink value. + */ + String logArtifactLink(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.RunGetLogResultInner object. + * + * @return the inner object. + */ + RunGetLogResultInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunListResult.java new file mode 100644 index 0000000000000..1bcab9cd72ae3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of runs. */ +@Fluent +public final class RunListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunListResult.class); + + /* + * The collection value. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next set of paged results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The collection value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection value. + * + * @param value the value value to set. + * @return the RunListResult object itself. + */ + public RunListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next set of paged results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next set of paged results. + * + * @param nextLink the nextLink value to set. + * @return the RunListResult object itself. + */ + public RunListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunRequest.java new file mode 100644 index 0000000000000..dde668694f81d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The request parameters for scheduling a run. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = RunRequest.class) +@JsonTypeName("RunRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DockerBuildRequest", value = DockerBuildRequest.class), + @JsonSubTypes.Type(name = "FileTaskRunRequest", value = FileTaskRunRequest.class), + @JsonSubTypes.Type(name = "TaskRunRequest", value = TaskRunRequest.class), + @JsonSubTypes.Type(name = "EncodedTaskRunRequest", value = EncodedTaskRunRequest.class) +}) +@Fluent +public class RunRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunRequest.class); + + /* + * The value that indicates whether archiving is enabled for the run or + * not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /* + * The dedicated agent pool for the run. + */ + @JsonProperty(value = "agentPoolName") + private String agentPoolName; + + /* + * The template that describes the repository and tag information for run + * log artifact. + */ + @JsonProperty(value = "logTemplate") + private String logTemplate; + + /** + * Get the isArchiveEnabled property: The value that indicates whether archiving is enabled for the run or not. + * + * @return the isArchiveEnabled value. + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the isArchiveEnabled property: The value that indicates whether archiving is enabled for the run or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set. + * @return the RunRequest object itself. + */ + public RunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * Get the agentPoolName property: The dedicated agent pool for the run. + * + * @return the agentPoolName value. + */ + public String agentPoolName() { + return this.agentPoolName; + } + + /** + * Set the agentPoolName property: The dedicated agent pool for the run. + * + * @param agentPoolName the agentPoolName value to set. + * @return the RunRequest object itself. + */ + public RunRequest withAgentPoolName(String agentPoolName) { + this.agentPoolName = agentPoolName; + return this; + } + + /** + * Get the logTemplate property: The template that describes the repository and tag information for run log + * artifact. + * + * @return the logTemplate value. + */ + public String logTemplate() { + return this.logTemplate; + } + + /** + * Set the logTemplate property: The template that describes the repository and tag information for run log + * artifact. + * + * @param logTemplate the logTemplate value to set. + * @return the RunRequest object itself. + */ + public RunRequest withLogTemplate(String logTemplate) { + this.logTemplate = logTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunStatus.java new file mode 100644 index 0000000000000..9d078f9be7022 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunStatus.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RunStatus. */ +public final class RunStatus extends ExpandableStringEnum { + /** Static value Queued for RunStatus. */ + public static final RunStatus QUEUED = fromString("Queued"); + + /** Static value Started for RunStatus. */ + public static final RunStatus STARTED = fromString("Started"); + + /** Static value Running for RunStatus. */ + public static final RunStatus RUNNING = fromString("Running"); + + /** Static value Succeeded for RunStatus. */ + public static final RunStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for RunStatus. */ + public static final RunStatus FAILED = fromString("Failed"); + + /** Static value Canceled for RunStatus. */ + public static final RunStatus CANCELED = fromString("Canceled"); + + /** Static value Error for RunStatus. */ + public static final RunStatus ERROR = fromString("Error"); + + /** Static value Timeout for RunStatus. */ + public static final RunStatus TIMEOUT = fromString("Timeout"); + + /** + * Creates or finds a RunStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RunStatus. + */ + @JsonCreator + public static RunStatus fromString(String name) { + return fromString(name, RunStatus.class); + } + + /** @return known RunStatus values. */ + public static Collection values() { + return values(RunStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunType.java new file mode 100644 index 0000000000000..24f506943181b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RunType. */ +public final class RunType extends ExpandableStringEnum { + /** Static value QuickBuild for RunType. */ + public static final RunType QUICK_BUILD = fromString("QuickBuild"); + + /** Static value QuickRun for RunType. */ + public static final RunType QUICK_RUN = fromString("QuickRun"); + + /** Static value AutoBuild for RunType. */ + public static final RunType AUTO_BUILD = fromString("AutoBuild"); + + /** Static value AutoRun for RunType. */ + public static final RunType AUTO_RUN = fromString("AutoRun"); + + /** + * Creates or finds a RunType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RunType. + */ + @JsonCreator + public static RunType fromString(String name) { + return fromString(name, RunType.class); + } + + /** @return known RunType values. */ + public static Collection values() { + return values(RunType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunUpdateParameters.java new file mode 100644 index 0000000000000..e4807e1109383 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunUpdateParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The set of run properties that can be updated. */ +@Fluent +public final class RunUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunUpdateParameters.class); + + /* + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * Get the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value. + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set. + * @return the RunUpdateParameters object itself. + */ + public RunUpdateParameters withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Runs.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Runs.java new file mode 100644 index 0000000000000..3bc7e51d2d89e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Runs.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Runs. */ +public interface Runs { + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed + * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the runs for a registry. + */ + PagedIterable list(String resourceGroupName, String registryName, String filter, Integer top, Context context); + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given run. + */ + Run get(String resourceGroupName, String registryName, String runId); + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given run. + */ + Response getWithResponse(String resourceGroupName, String registryName, String runId, Context context); + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + Run update(String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters); + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param runUpdateParameters The run update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + Run update( + String resourceGroupName, + String registryName, + String runId, + RunUpdateParameters runUpdateParameters, + Context context); + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs. + */ + RunGetLogResult getLogSasUrl(String resourceGroupName, String registryName, String runId); + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs. + */ + Response getLogSasUrlWithResponse( + String resourceGroupName, String registryName, String runId, Context context); + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String registryName, String runId); + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String registryName, String runId, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMap.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMap.java new file mode 100644 index 0000000000000..7dadbe3f736ce --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMap.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of ScopeMap. */ +public interface ScopeMap { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the description property: The user friendly description of the scope map. + * + * @return the description value. + */ + String description(); + + /** + * Gets the typePropertiesType property: The type of the scope map. E.g. BuildIn scope map. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the actions property: The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner object. + * + * @return the inner object. + */ + ScopeMapInner innerModel(); + + /** The entirety of the ScopeMap definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ScopeMap definition stages. */ + interface DefinitionStages { + /** The first stage of the ScopeMap definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ScopeMap definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the ScopeMap definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithDescription, DefinitionStages.WithActions { + /** + * Executes the create request. + * + * @return the created resource. + */ + ScopeMap create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ScopeMap create(Context context); + } + /** The stage of the ScopeMap definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The user friendly description of the scope map.. + * + * @param description The user friendly description of the scope map. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the ScopeMap definition allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * + * @param actions The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * @return the next definition stage. + */ + WithCreate withActions(List actions); + } + } + /** + * Begins update for the ScopeMap resource. + * + * @return the stage of resource update. + */ + ScopeMap.Update update(); + + /** The template for ScopeMap update. */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithActions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ScopeMap apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ScopeMap apply(Context context); + } + /** The ScopeMap update stages. */ + interface UpdateStages { + /** The stage of the ScopeMap update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The user friendly description of the scope map.. + * + * @param description The user friendly description of the scope map. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the ScopeMap update allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: The list of scope permissions for registry artifacts. E.g. + * repositories/repository-name/pull, repositories/repository-name/delete. + * + * @param actions The list of scope permissions for registry artifacts. E.g. + * repositories/repository-name/pull, repositories/repository-name/delete. + * @return the next definition stage. + */ + Update withActions(List actions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ScopeMap refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ScopeMap refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapListResult.java new file mode 100644 index 0000000000000..d87961a441d4d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list scope maps for a container registry. */ +@Fluent +public final class ScopeMapListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScopeMapListResult.class); + + /* + * The list of scope maps. Since this list may be incomplete, the nextLink + * field should be used to request the next list of scope maps. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of scope maps. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of scope maps. Since this list may be incomplete, the nextLink field should be + * used to request the next list of scope maps. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of scope maps. Since this list may be incomplete, the nextLink field should be + * used to request the next list of scope maps. + * + * @param value the value value to set. + * @return the ScopeMapListResult object itself. + */ + public ScopeMapListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of scope maps. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of scope maps. + * + * @param nextLink the nextLink value to set. + * @return the ScopeMapListResult object itself. + */ + public ScopeMapListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapUpdateParameters.java new file mode 100644 index 0000000000000..c56db1f95bf9b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapUpdateParameters.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties for updating the scope map. */ +@JsonFlatten +@Fluent +public class ScopeMapUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScopeMapUpdateParameters.class); + + /* + * The user friendly description of the scope map. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The list of scope permissions for registry artifacts. + * E.g. repositories/repository-name/pull, + * repositories/repository-name/delete + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * Get the description property: The user friendly description of the scope map. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The user friendly description of the scope map. + * + * @param description the description value to set. + * @return the ScopeMapUpdateParameters object itself. + */ + public ScopeMapUpdateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actions property: The list of scope permissions for registry artifacts. E.g. + * repositories/repository-name/pull, repositories/repository-name/delete. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: The list of scope permissions for registry artifacts. E.g. + * repositories/repository-name/pull, repositories/repository-name/delete. + * + * @param actions the actions value to set. + * @return the ScopeMapUpdateParameters object itself. + */ + public ScopeMapUpdateParameters withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMaps.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMaps.java new file mode 100644 index 0000000000000..9d6a2edf133fb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMaps.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ScopeMaps. */ +public interface ScopeMaps { + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + ScopeMap get(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified scope map. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + ScopeMap getById(String id); + + /** + * Gets the properties of the specified scope map. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a scope map from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a scope map from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ScopeMap resource. + * + * @param name resource name. + * @return the first stage of the new ScopeMap definition. + */ + ScopeMap.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SecretObject.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SecretObject.java new file mode 100644 index 0000000000000..ae193c3505aa3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SecretObject.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a secret object value. */ +@Fluent +public final class SecretObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretObject.class); + + /* + * The value of the secret. The format of this value will be determined + * based on the type of the secret object. If the type is Opaque, the value + * will be + * used as is without any modification. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The type of the secret object which determines how the value of the + * secret object has to be + * interpreted. + */ + @JsonProperty(value = "type") + private SecretObjectType type; + + /** + * Get the value property: The value of the secret. The format of this value will be determined based on the type of + * the secret object. If the type is Opaque, the value will be used as is without any modification. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the secret. The format of this value will be determined based on the type of + * the secret object. If the type is Opaque, the value will be used as is without any modification. + * + * @param value the value value to set. + * @return the SecretObject object itself. + */ + public SecretObject withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the type property: The type of the secret object which determines how the value of the secret object has to + * be interpreted. + * + * @return the type value. + */ + public SecretObjectType type() { + return this.type; + } + + /** + * Set the type property: The type of the secret object which determines how the value of the secret object has to + * be interpreted. + * + * @param type the type value to set. + * @return the SecretObject object itself. + */ + public SecretObject withType(SecretObjectType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SecretObjectType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SecretObjectType.java new file mode 100644 index 0000000000000..b28769b882396 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SecretObjectType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecretObjectType. */ +public final class SecretObjectType extends ExpandableStringEnum { + /** Static value Opaque for SecretObjectType. */ + public static final SecretObjectType OPAQUE = fromString("Opaque"); + + /** Static value Vaultsecret for SecretObjectType. */ + public static final SecretObjectType VAULTSECRET = fromString("Vaultsecret"); + + /** + * Creates or finds a SecretObjectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecretObjectType. + */ + @JsonCreator + public static SecretObjectType fromString(String name) { + return fromString(name, SecretObjectType.class); + } + + /** @return known SecretObjectType values. */ + public static Collection values() { + return values(SecretObjectType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SetValue.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SetValue.java new file mode 100644 index 0000000000000..d62f6b892c8f0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SetValue.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a overridable value that can be passed to a task template. */ +@Fluent +public final class SetValue { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SetValue.class); + + /* + * The name of the overridable value. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The overridable value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /* + * Flag to indicate whether the value represents a secret or not. + */ + @JsonProperty(value = "isSecret") + private Boolean isSecret; + + /** + * Get the name property: The name of the overridable value. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the overridable value. + * + * @param name the name value to set. + * @return the SetValue object itself. + */ + public SetValue withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The overridable value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The overridable value. + * + * @param value the value value to set. + * @return the SetValue object itself. + */ + public SetValue withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the isSecret property: Flag to indicate whether the value represents a secret or not. + * + * @return the isSecret value. + */ + public Boolean isSecret() { + return this.isSecret; + } + + /** + * Set the isSecret property: Flag to indicate whether the value represents a secret or not. + * + * @param isSecret the isSecret value to set. + * @return the SetValue object itself. + */ + public SetValue withIsSecret(Boolean isSecret) { + this.isSecret = isSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model SetValue")); + } + if (value() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property value in model SetValue")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Sku.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Sku.java new file mode 100644 index 0000000000000..f4895cba985fa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Sku.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU of a container registry. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * The SKU name of the container registry. Required for registry creation. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /* + * The SKU tier based on the SKU name. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * Get the name property: The SKU name of the container registry. Required for registry creation. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: The SKU name of the container registry. Required for registry creation. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The SKU tier based on the SKU name. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuName.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuName.java new file mode 100644 index 0000000000000..08a185d5f81a5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuName.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Classic for SkuName. */ + public static final SkuName CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** Static value Premium for SkuName. */ + public static final SkuName PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** @return known SkuName values. */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuTier.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuTier.java new file mode 100644 index 0000000000000..c1b59acaf4449 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuTier.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuTier. */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Classic for SkuTier. */ + public static final SkuTier CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for SkuTier. */ + public static final SkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuTier. + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** @return known SkuTier values. */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Source.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Source.java new file mode 100644 index 0000000000000..8f20015cb4d9c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Source.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@Fluent +public final class Source { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Source.class); + + /* + * 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 addr property: 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 addr property: 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 instanceId property: The running instance of an application. Changes after each restart. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instanceId property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceControlType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceControlType.java new file mode 100644 index 0000000000000..6bd9d0d37291f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceControlType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SourceControlType. */ +public final class SourceControlType extends ExpandableStringEnum { + /** Static value Github for SourceControlType. */ + public static final SourceControlType GITHUB = fromString("Github"); + + /** Static value VisualStudioTeamService for SourceControlType. */ + public static final SourceControlType VISUAL_STUDIO_TEAM_SERVICE = fromString("VisualStudioTeamService"); + + /** + * Creates or finds a SourceControlType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceControlType. + */ + @JsonCreator + public static SourceControlType fromString(String name) { + return fromString(name, SourceControlType.class); + } + + /** @return known SourceControlType values. */ + public static Collection values() { + return values(SourceControlType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceProperties.java new file mode 100644 index 0000000000000..4beb2defc05ee --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the source code repository. */ +@Fluent +public final class SourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceProperties.class); + + /* + * The type of source control service. + */ + @JsonProperty(value = "sourceControlType", required = true) + private SourceControlType sourceControlType; + + /* + * The full URL to the source code repository + */ + @JsonProperty(value = "repositoryUrl", required = true) + private String repositoryUrl; + + /* + * The branch name of the source code. + */ + @JsonProperty(value = "branch") + private String branch; + + /* + * The authorization properties for accessing the source code repository + * and to set up + * webhooks for notifications. + */ + @JsonProperty(value = "sourceControlAuthProperties") + private AuthInfo sourceControlAuthProperties; + + /** + * Get the sourceControlType property: The type of source control service. + * + * @return the sourceControlType value. + */ + public SourceControlType sourceControlType() { + return this.sourceControlType; + } + + /** + * Set the sourceControlType property: The type of source control service. + * + * @param sourceControlType the sourceControlType value to set. + * @return the SourceProperties object itself. + */ + public SourceProperties withSourceControlType(SourceControlType sourceControlType) { + this.sourceControlType = sourceControlType; + return this; + } + + /** + * Get the repositoryUrl property: The full URL to the source code repository. + * + * @return the repositoryUrl value. + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the repositoryUrl property: The full URL to the source code repository. + * + * @param repositoryUrl the repositoryUrl value to set. + * @return the SourceProperties object itself. + */ + public SourceProperties withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branch property: The branch name of the source code. + * + * @return the branch value. + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch property: The branch name of the source code. + * + * @param branch the branch value to set. + * @return the SourceProperties object itself. + */ + public SourceProperties withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the sourceControlAuthProperties property: The authorization properties for accessing the source code + * repository and to set up webhooks for notifications. + * + * @return the sourceControlAuthProperties value. + */ + public AuthInfo sourceControlAuthProperties() { + return this.sourceControlAuthProperties; + } + + /** + * Set the sourceControlAuthProperties property: The authorization properties for accessing the source code + * repository and to set up webhooks for notifications. + * + * @param sourceControlAuthProperties the sourceControlAuthProperties value to set. + * @return the SourceProperties object itself. + */ + public SourceProperties withSourceControlAuthProperties(AuthInfo sourceControlAuthProperties) { + this.sourceControlAuthProperties = sourceControlAuthProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceControlType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceControlType in model SourceProperties")); + } + if (repositoryUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property repositoryUrl in model SourceProperties")); + } + if (sourceControlAuthProperties() != null) { + sourceControlAuthProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceRegistryCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceRegistryCredentials.java new file mode 100644 index 0000000000000..fafedf3810e5b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceRegistryCredentials.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the credential parameters for accessing the source registry. */ +@Fluent +public final class SourceRegistryCredentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceRegistryCredentials.class); + + /* + * The authentication mode which determines the source registry login + * scope. The credentials for the source registry + * will be generated using the given scope. These credentials will be used + * to login to + * the source registry during the run. + */ + @JsonProperty(value = "loginMode") + private SourceRegistryLoginMode loginMode; + + /** + * Get the loginMode property: The authentication mode which determines the source registry login scope. The + * credentials for the source registry will be generated using the given scope. These credentials will be used to + * login to the source registry during the run. + * + * @return the loginMode value. + */ + public SourceRegistryLoginMode loginMode() { + return this.loginMode; + } + + /** + * Set the loginMode property: The authentication mode which determines the source registry login scope. The + * credentials for the source registry will be generated using the given scope. These credentials will be used to + * login to the source registry during the run. + * + * @param loginMode the loginMode value to set. + * @return the SourceRegistryCredentials object itself. + */ + public SourceRegistryCredentials withLoginMode(SourceRegistryLoginMode loginMode) { + this.loginMode = loginMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceRegistryLoginMode.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceRegistryLoginMode.java new file mode 100644 index 0000000000000..7ed66d9bfce92 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceRegistryLoginMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SourceRegistryLoginMode. */ +public final class SourceRegistryLoginMode extends ExpandableStringEnum { + /** Static value None for SourceRegistryLoginMode. */ + public static final SourceRegistryLoginMode NONE = fromString("None"); + + /** Static value Default for SourceRegistryLoginMode. */ + public static final SourceRegistryLoginMode DEFAULT = fromString("Default"); + + /** + * Creates or finds a SourceRegistryLoginMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceRegistryLoginMode. + */ + @JsonCreator + public static SourceRegistryLoginMode fromString(String name) { + return fromString(name, SourceRegistryLoginMode.class); + } + + /** @return known SourceRegistryLoginMode values. */ + public static Collection values() { + return values(SourceRegistryLoginMode.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTrigger.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTrigger.java new file mode 100644 index 0000000000000..a3019cde43cd6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTrigger.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a source based trigger. */ +@Fluent +public final class SourceTrigger { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceTrigger.class); + + /* + * The properties that describes the source(code) for the task. + */ + @JsonProperty(value = "sourceRepository", required = true) + private SourceProperties sourceRepository; + + /* + * The source event corresponding to the trigger. + */ + @JsonProperty(value = "sourceTriggerEvents", required = true) + private List sourceTriggerEvents; + + /* + * The current status of trigger. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /* + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the sourceRepository property: The properties that describes the source(code) for the task. + * + * @return the sourceRepository value. + */ + public SourceProperties sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the sourceRepository property: The properties that describes the source(code) for the task. + * + * @param sourceRepository the sourceRepository value to set. + * @return the SourceTrigger object itself. + */ + public SourceTrigger withSourceRepository(SourceProperties sourceRepository) { + this.sourceRepository = sourceRepository; + return this; + } + + /** + * Get the sourceTriggerEvents property: The source event corresponding to the trigger. + * + * @return the sourceTriggerEvents value. + */ + public List sourceTriggerEvents() { + return this.sourceTriggerEvents; + } + + /** + * Set the sourceTriggerEvents property: The source event corresponding to the trigger. + * + * @param sourceTriggerEvents the sourceTriggerEvents value to set. + * @return the SourceTrigger object itself. + */ + public SourceTrigger withSourceTriggerEvents(List sourceTriggerEvents) { + this.sourceTriggerEvents = sourceTriggerEvents; + return this; + } + + /** + * Get the status property: The current status of trigger. + * + * @return the status value. + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of trigger. + * + * @param status the status value to set. + * @return the SourceTrigger object itself. + */ + public SourceTrigger withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name property: The name of the trigger. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the trigger. + * + * @param name the name value to set. + * @return the SourceTrigger object itself. + */ + public SourceTrigger withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceRepository() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sourceRepository in model SourceTrigger")); + } else { + sourceRepository().validate(); + } + if (sourceTriggerEvents() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceTriggerEvents in model SourceTrigger")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model SourceTrigger")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerDescriptor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerDescriptor.java new file mode 100644 index 0000000000000..e13edfe3800ff --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerDescriptor.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The source trigger that caused a run. */ +@Fluent +public final class SourceTriggerDescriptor { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceTriggerDescriptor.class); + + /* + * The unique ID of the trigger. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The event type of the trigger. + */ + @JsonProperty(value = "eventType") + private String eventType; + + /* + * The unique ID that identifies a commit. + */ + @JsonProperty(value = "commitId") + private String commitId; + + /* + * The unique ID that identifies pull request. + */ + @JsonProperty(value = "pullRequestId") + private String pullRequestId; + + /* + * The repository URL. + */ + @JsonProperty(value = "repositoryUrl") + private String repositoryUrl; + + /* + * The branch name in the repository. + */ + @JsonProperty(value = "branchName") + private String branchName; + + /* + * The source control provider type. + */ + @JsonProperty(value = "providerType") + private String providerType; + + /** + * Get the id property: The unique ID of the trigger. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The unique ID of the trigger. + * + * @param id the id value to set. + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withId(String id) { + this.id = id; + return this; + } + + /** + * Get the eventType property: The event type of the trigger. + * + * @return the eventType value. + */ + public String eventType() { + return this.eventType; + } + + /** + * Set the eventType property: The event type of the trigger. + * + * @param eventType the eventType value to set. + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withEventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the commitId property: The unique ID that identifies a commit. + * + * @return the commitId value. + */ + public String commitId() { + return this.commitId; + } + + /** + * Set the commitId property: The unique ID that identifies a commit. + * + * @param commitId the commitId value to set. + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withCommitId(String commitId) { + this.commitId = commitId; + return this; + } + + /** + * Get the pullRequestId property: The unique ID that identifies pull request. + * + * @return the pullRequestId value. + */ + public String pullRequestId() { + return this.pullRequestId; + } + + /** + * Set the pullRequestId property: The unique ID that identifies pull request. + * + * @param pullRequestId the pullRequestId value to set. + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withPullRequestId(String pullRequestId) { + this.pullRequestId = pullRequestId; + return this; + } + + /** + * Get the repositoryUrl property: The repository URL. + * + * @return the repositoryUrl value. + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the repositoryUrl property: The repository URL. + * + * @param repositoryUrl the repositoryUrl value to set. + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branchName property: The branch name in the repository. + * + * @return the branchName value. + */ + public String branchName() { + return this.branchName; + } + + /** + * Set the branchName property: The branch name in the repository. + * + * @param branchName the branchName value to set. + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withBranchName(String branchName) { + this.branchName = branchName; + return this; + } + + /** + * Get the providerType property: The source control provider type. + * + * @return the providerType value. + */ + public String providerType() { + return this.providerType; + } + + /** + * Set the providerType property: The source control provider type. + * + * @param providerType the providerType value to set. + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withProviderType(String providerType) { + this.providerType = providerType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerEvent.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerEvent.java new file mode 100644 index 0000000000000..271246a1c445c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerEvent.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SourceTriggerEvent. */ +public final class SourceTriggerEvent extends ExpandableStringEnum { + /** Static value commit for SourceTriggerEvent. */ + public static final SourceTriggerEvent COMMIT = fromString("commit"); + + /** Static value pullrequest for SourceTriggerEvent. */ + public static final SourceTriggerEvent PULLREQUEST = fromString("pullrequest"); + + /** + * Creates or finds a SourceTriggerEvent from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceTriggerEvent. + */ + @JsonCreator + public static SourceTriggerEvent fromString(String name) { + return fromString(name, SourceTriggerEvent.class); + } + + /** @return known SourceTriggerEvent values. */ + public static Collection values() { + return values(SourceTriggerEvent.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerUpdateParameters.java new file mode 100644 index 0000000000000..a50d6b1713d0f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerUpdateParameters.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties for updating a source based trigger. */ +@Fluent +public final class SourceTriggerUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceTriggerUpdateParameters.class); + + /* + * The properties that describes the source(code) for the task. + */ + @JsonProperty(value = "sourceRepository") + private SourceUpdateParameters sourceRepository; + + /* + * The source event corresponding to the trigger. + */ + @JsonProperty(value = "sourceTriggerEvents") + private List sourceTriggerEvents; + + /* + * The current status of trigger. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /* + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the sourceRepository property: The properties that describes the source(code) for the task. + * + * @return the sourceRepository value. + */ + public SourceUpdateParameters sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the sourceRepository property: The properties that describes the source(code) for the task. + * + * @param sourceRepository the sourceRepository value to set. + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withSourceRepository(SourceUpdateParameters sourceRepository) { + this.sourceRepository = sourceRepository; + return this; + } + + /** + * Get the sourceTriggerEvents property: The source event corresponding to the trigger. + * + * @return the sourceTriggerEvents value. + */ + public List sourceTriggerEvents() { + return this.sourceTriggerEvents; + } + + /** + * Set the sourceTriggerEvents property: The source event corresponding to the trigger. + * + * @param sourceTriggerEvents the sourceTriggerEvents value to set. + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withSourceTriggerEvents(List sourceTriggerEvents) { + this.sourceTriggerEvents = sourceTriggerEvents; + return this; + } + + /** + * Get the status property: The current status of trigger. + * + * @return the status value. + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of trigger. + * + * @param status the status value to set. + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name property: The name of the trigger. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the trigger. + * + * @param name the name value to set. + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceRepository() != null) { + sourceRepository().validate(); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model SourceTriggerUpdateParameters")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceUpdateParameters.java new file mode 100644 index 0000000000000..f9c7680715740 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceUpdateParameters.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties for updating the source code repository. */ +@Fluent +public final class SourceUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceUpdateParameters.class); + + /* + * The type of source control service. + */ + @JsonProperty(value = "sourceControlType") + private SourceControlType sourceControlType; + + /* + * The full URL to the source code repository + */ + @JsonProperty(value = "repositoryUrl") + private String repositoryUrl; + + /* + * The branch name of the source code. + */ + @JsonProperty(value = "branch") + private String branch; + + /* + * The authorization properties for accessing the source code repository + * and to set up + * webhooks for notifications. + */ + @JsonProperty(value = "sourceControlAuthProperties") + private AuthInfoUpdateParameters sourceControlAuthProperties; + + /** + * Get the sourceControlType property: The type of source control service. + * + * @return the sourceControlType value. + */ + public SourceControlType sourceControlType() { + return this.sourceControlType; + } + + /** + * Set the sourceControlType property: The type of source control service. + * + * @param sourceControlType the sourceControlType value to set. + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withSourceControlType(SourceControlType sourceControlType) { + this.sourceControlType = sourceControlType; + return this; + } + + /** + * Get the repositoryUrl property: The full URL to the source code repository. + * + * @return the repositoryUrl value. + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the repositoryUrl property: The full URL to the source code repository. + * + * @param repositoryUrl the repositoryUrl value to set. + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branch property: The branch name of the source code. + * + * @return the branch value. + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch property: The branch name of the source code. + * + * @param branch the branch value to set. + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the sourceControlAuthProperties property: The authorization properties for accessing the source code + * repository and to set up webhooks for notifications. + * + * @return the sourceControlAuthProperties value. + */ + public AuthInfoUpdateParameters sourceControlAuthProperties() { + return this.sourceControlAuthProperties; + } + + /** + * Set the sourceControlAuthProperties property: The authorization properties for accessing the source code + * repository and to set up webhooks for notifications. + * + * @param sourceControlAuthProperties the sourceControlAuthProperties value to set. + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withSourceControlAuthProperties( + AuthInfoUpdateParameters sourceControlAuthProperties) { + this.sourceControlAuthProperties = sourceControlAuthProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceControlAuthProperties() != null) { + sourceControlAuthProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceUploadDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceUploadDefinition.java new file mode 100644 index 0000000000000..5d36528f18d75 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceUploadDefinition.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.SourceUploadDefinitionInner; + +/** An immutable client-side representation of SourceUploadDefinition. */ +public interface SourceUploadDefinition { + /** + * Gets the uploadUrl property: The URL where the client can upload the source. + * + * @return the uploadUrl value. + */ + String uploadUrl(); + + /** + * Gets the relativePath property: The relative path to the source. This is used to submit the subsequent queue + * build request. + * + * @return the relativePath value. + */ + String relativePath(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.SourceUploadDefinitionInner + * object. + * + * @return the inner object. + */ + SourceUploadDefinitionInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Status.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Status.java new file mode 100644 index 0000000000000..45ec1477f6a66 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Status.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The status of an Azure resource at the time the operation was called. */ +@Immutable +public final class Status { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Status.class); + + /* + * 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 OffsetDateTime timestamp; + + /** + * Get the displayStatus property: The short label for the status. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the message property: The detailed message for the status, including alerts and error messages. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the timestamp property: The timestamp when the status was changed to the current value. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StatusDetailProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StatusDetailProperties.java new file mode 100644 index 0000000000000..1c1bbce22c1b1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StatusDetailProperties.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The status detail properties of the connected registry. */ +@Immutable +public final class StatusDetailProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StatusDetailProperties.class); + + /* + * The component of the connected registry corresponding to the status. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The code of the status. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The description of the status. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The timestamp of the status. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * The correlation ID of the status. + */ + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; + + /** + * Get the type property: The component of the connected registry corresponding to the status. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the code property: The code of the status. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the description property: The description of the status. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the timestamp property: The timestamp of the status. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the correlationId property: The correlation ID of the status. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StepType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StepType.java new file mode 100644 index 0000000000000..65dedf5bf75d5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StepType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StepType. */ +public final class StepType extends ExpandableStringEnum { + /** Static value Docker for StepType. */ + public static final StepType DOCKER = fromString("Docker"); + + /** Static value FileTask for StepType. */ + public static final StepType FILE_TASK = fromString("FileTask"); + + /** Static value EncodedTask for StepType. */ + public static final StepType ENCODED_TASK = fromString("EncodedTask"); + + /** + * Creates or finds a StepType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StepType. + */ + @JsonCreator + public static StepType fromString(String name) { + return fromString(name, StepType.class); + } + + /** @return known StepType values. */ + public static Collection values() { + return values(StepType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncProperties.java new file mode 100644 index 0000000000000..d7e84950ddf8b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncProperties.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** The sync properties of the connected registry with its parent. */ +@Fluent +public final class SyncProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncProperties.class); + + /* + * The resource ID of the ACR token used to authenticate the connected + * registry to its parent during sync. + */ + @JsonProperty(value = "tokenId", required = true) + private String tokenId; + + /* + * The cron expression indicating the schedule that the connected registry + * will sync with its parent. + */ + @JsonProperty(value = "schedule") + private String schedule; + + /* + * The time window during which sync is enabled for each schedule + * occurrence. Specify the duration using the format + * P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + */ + @JsonProperty(value = "syncWindow") + private Duration syncWindow; + + /* + * The period of time for which a message is available to sync before it is + * expired. Specify the duration using the format + * P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + */ + @JsonProperty(value = "messageTtl", required = true) + private Duration messageTtl; + + /* + * The last time a sync occurred between the connected registry and its + * parent. + */ + @JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSyncTime; + + /* + * The gateway endpoint used by the connected registry to communicate with + * its parent. + */ + @JsonProperty(value = "gatewayEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayEndpoint; + + /** + * Get the tokenId property: The resource ID of the ACR token used to authenticate the connected registry to its + * parent during sync. + * + * @return the tokenId value. + */ + public String tokenId() { + return this.tokenId; + } + + /** + * Set the tokenId property: The resource ID of the ACR token used to authenticate the connected registry to its + * parent during sync. + * + * @param tokenId the tokenId value to set. + * @return the SyncProperties object itself. + */ + public SyncProperties withTokenId(String tokenId) { + this.tokenId = tokenId; + return this; + } + + /** + * Get the schedule property: The cron expression indicating the schedule that the connected registry will sync with + * its parent. + * + * @return the schedule value. + */ + public String schedule() { + return this.schedule; + } + + /** + * Set the schedule property: The cron expression indicating the schedule that the connected registry will sync with + * its parent. + * + * @param schedule the schedule value to set. + * @return the SyncProperties object itself. + */ + public SyncProperties withSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the syncWindow property: The time window during which sync is enabled for each schedule occurrence. Specify + * the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @return the syncWindow value. + */ + public Duration syncWindow() { + return this.syncWindow; + } + + /** + * Set the syncWindow property: The time window during which sync is enabled for each schedule occurrence. Specify + * the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @param syncWindow the syncWindow value to set. + * @return the SyncProperties object itself. + */ + public SyncProperties withSyncWindow(Duration syncWindow) { + this.syncWindow = syncWindow; + return this; + } + + /** + * Get the messageTtl property: The period of time for which a message is available to sync before it is expired. + * Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @return the messageTtl value. + */ + public Duration messageTtl() { + return this.messageTtl; + } + + /** + * Set the messageTtl property: The period of time for which a message is available to sync before it is expired. + * Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @param messageTtl the messageTtl value to set. + * @return the SyncProperties object itself. + */ + public SyncProperties withMessageTtl(Duration messageTtl) { + this.messageTtl = messageTtl; + return this; + } + + /** + * Get the lastSyncTime property: The last time a sync occurred between the connected registry and its parent. + * + * @return the lastSyncTime value. + */ + public OffsetDateTime lastSyncTime() { + return this.lastSyncTime; + } + + /** + * Get the gatewayEndpoint property: The gateway endpoint used by the connected registry to communicate with its + * parent. + * + * @return the gatewayEndpoint value. + */ + public String gatewayEndpoint() { + return this.gatewayEndpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tokenId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property tokenId in model SyncProperties")); + } + if (messageTtl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property messageTtl in model SyncProperties")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncUpdateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncUpdateProperties.java new file mode 100644 index 0000000000000..e4efaa9b2fde6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncUpdateProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** The parameters for updating the sync properties of the connected registry with its parent. */ +@Fluent +public final class SyncUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncUpdateProperties.class); + + /* + * The cron expression indicating the schedule that the connected registry + * will sync with its parent. + */ + @JsonProperty(value = "schedule") + private String schedule; + + /* + * The time window during which sync is enabled for each schedule + * occurrence. Specify the duration using the format + * P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + */ + @JsonProperty(value = "syncWindow") + private Duration syncWindow; + + /* + * The period of time for which a message is available to sync before it is + * expired. Specify the duration using the format + * P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + */ + @JsonProperty(value = "messageTtl") + private Duration messageTtl; + + /** + * Get the schedule property: The cron expression indicating the schedule that the connected registry will sync with + * its parent. + * + * @return the schedule value. + */ + public String schedule() { + return this.schedule; + } + + /** + * Set the schedule property: The cron expression indicating the schedule that the connected registry will sync with + * its parent. + * + * @param schedule the schedule value to set. + * @return the SyncUpdateProperties object itself. + */ + public SyncUpdateProperties withSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the syncWindow property: The time window during which sync is enabled for each schedule occurrence. Specify + * the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @return the syncWindow value. + */ + public Duration syncWindow() { + return this.syncWindow; + } + + /** + * Set the syncWindow property: The time window during which sync is enabled for each schedule occurrence. Specify + * the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @param syncWindow the syncWindow value to set. + * @return the SyncUpdateProperties object itself. + */ + public SyncUpdateProperties withSyncWindow(Duration syncWindow) { + this.syncWindow = syncWindow; + return this; + } + + /** + * Get the messageTtl property: The period of time for which a message is available to sync before it is expired. + * Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @return the messageTtl value. + */ + public Duration messageTtl() { + return this.messageTtl; + } + + /** + * Set the messageTtl property: The period of time for which a message is available to sync before it is expired. + * Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @param messageTtl the messageTtl value to set. + * @return the SyncUpdateProperties object itself. + */ + public SyncUpdateProperties withMessageTtl(Duration messageTtl) { + this.messageTtl = messageTtl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Target.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Target.java new file mode 100644 index 0000000000000..4dca170aa8928 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Target.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The target of the event. */ +@Fluent +public final class Target { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Target.class); + + /* + * The MIME type of the referenced object. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /* + * The number of bytes of the content. Same as Length field. + */ + @JsonProperty(value = "size") + private Long size; + + /* + * The digest of the content, as defined by the Registry V2 HTTP API + * Specification. + */ + @JsonProperty(value = "digest") + private String digest; + + /* + * The number of bytes of the content. Same as Size field. + */ + @JsonProperty(value = "length") + private Long length; + + /* + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /* + * The direct URL to the content. + */ + @JsonProperty(value = "url") + private String url; + + /* + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /* + * The name of the artifact. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The version of the artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the mediaType property: The MIME type of the referenced object. + * + * @return the mediaType value. + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the mediaType property: 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 size property: The number of bytes of the content. Same as Length field. + * + * @return the size value. + */ + public Long size() { + return this.size; + } + + /** + * Set the size property: 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 property: 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 property: 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 length property: The number of bytes of the content. Same as Size field. + * + * @return the length value. + */ + public Long length() { + return this.length; + } + + /** + * Set the length property: 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 property: The repository name. + * + * @return the repository value. + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository property: 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 url property: The direct URL to the content. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: 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 property: The tag name. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: The tag name. + * + * @param tag the tag value to set. + * @return the Target object itself. + */ + public Target withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the name property: The name of the artifact. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the artifact. + * + * @param name the name value to set. + * @return the Target object itself. + */ + public Target withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version property: The version of the artifact. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the artifact. + * + * @param version the version value to set. + * @return the Target object itself. + */ + public Target withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Task.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Task.java new file mode 100644 index 0000000000000..fec8b4ddece3d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Task.java @@ -0,0 +1,557 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of Task. */ +public interface Task { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: Identity for the resource. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the provisioningState property: The provisioning state of the task. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the creationDate property: The creation date of task. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the status property: The current status of task. + * + * @return the status value. + */ + TaskStatus status(); + + /** + * Gets the platform property: The platform properties against which the run has to happen. + * + * @return the platform value. + */ + PlatformProperties platform(); + + /** + * Gets the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + AgentProperties agentConfiguration(); + + /** + * Gets the agentPoolName property: The dedicated agent pool for the task. + * + * @return the agentPoolName value. + */ + String agentPoolName(); + + /** + * Gets the timeout property: Run timeout in seconds. + * + * @return the timeout value. + */ + Integer timeout(); + + /** + * Gets the step property: The properties of a task step. + * + * @return the step value. + */ + TaskStepProperties step(); + + /** + * Gets the trigger property: The properties that describe all triggers for the task. + * + * @return the trigger value. + */ + TriggerProperties trigger(); + + /** + * Gets the credentials property: The properties that describes a set of credentials that will be used when this run + * is invoked. + * + * @return the credentials value. + */ + Credentials credentials(); + + /** + * Gets the logTemplate property: The template that describes the repository and tag information for run log + * artifact. + * + * @return the logTemplate value. + */ + String logTemplate(); + + /** + * Gets the isSystemTask property: The value of this property indicates whether the task resource is system task or + * not. + * + * @return the isSystemTask value. + */ + Boolean isSystemTask(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskInner object. + * + * @return the inner object. + */ + TaskInner innerModel(); + + /** The entirety of the Task definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Task definition stages. */ + interface DefinitionStages { + /** The first stage of the Task definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Task definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Task definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the Task definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithStatus, + DefinitionStages.WithPlatform, + DefinitionStages.WithAgentConfiguration, + DefinitionStages.WithAgentPoolName, + DefinitionStages.WithTimeout, + DefinitionStages.WithStep, + DefinitionStages.WithTrigger, + DefinitionStages.WithCredentials, + DefinitionStages.WithLogTemplate, + DefinitionStages.WithIsSystemTask { + /** + * Executes the create request. + * + * @return the created resource. + */ + Task create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Task create(Context context); + } + /** The stage of the Task definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Task definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity for the resource.. + * + * @param identity Identity for the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + /** The stage of the Task definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The current status of task.. + * + * @param status The current status of task. + * @return the next definition stage. + */ + WithCreate withStatus(TaskStatus status); + } + /** The stage of the Task definition allowing to specify platform. */ + interface WithPlatform { + /** + * Specifies the platform property: The platform properties against which the run has to happen.. + * + * @param platform The platform properties against which the run has to happen. + * @return the next definition stage. + */ + WithCreate withPlatform(PlatformProperties platform); + } + /** The stage of the Task definition allowing to specify agentConfiguration. */ + interface WithAgentConfiguration { + /** + * Specifies the agentConfiguration property: The machine configuration of the run agent.. + * + * @param agentConfiguration The machine configuration of the run agent. + * @return the next definition stage. + */ + WithCreate withAgentConfiguration(AgentProperties agentConfiguration); + } + /** The stage of the Task definition allowing to specify agentPoolName. */ + interface WithAgentPoolName { + /** + * Specifies the agentPoolName property: The dedicated agent pool for the task.. + * + * @param agentPoolName The dedicated agent pool for the task. + * @return the next definition stage. + */ + WithCreate withAgentPoolName(String agentPoolName); + } + /** The stage of the Task definition allowing to specify timeout. */ + interface WithTimeout { + /** + * Specifies the timeout property: Run timeout in seconds.. + * + * @param timeout Run timeout in seconds. + * @return the next definition stage. + */ + WithCreate withTimeout(Integer timeout); + } + /** The stage of the Task definition allowing to specify step. */ + interface WithStep { + /** + * Specifies the step property: The properties of a task step.. + * + * @param step The properties of a task step. + * @return the next definition stage. + */ + WithCreate withStep(TaskStepProperties step); + } + /** The stage of the Task definition allowing to specify trigger. */ + interface WithTrigger { + /** + * Specifies the trigger property: The properties that describe all triggers for the task.. + * + * @param trigger The properties that describe all triggers for the task. + * @return the next definition stage. + */ + WithCreate withTrigger(TriggerProperties trigger); + } + /** The stage of the Task definition allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: The properties that describes a set of credentials that will be used + * when this run is invoked.. + * + * @param credentials The properties that describes a set of credentials that will be used when this run is + * invoked. + * @return the next definition stage. + */ + WithCreate withCredentials(Credentials credentials); + } + /** The stage of the Task definition allowing to specify logTemplate. */ + interface WithLogTemplate { + /** + * Specifies the logTemplate property: The template that describes the repository and tag information for + * run log artifact.. + * + * @param logTemplate The template that describes the repository and tag information for run log artifact. + * @return the next definition stage. + */ + WithCreate withLogTemplate(String logTemplate); + } + /** The stage of the Task definition allowing to specify isSystemTask. */ + interface WithIsSystemTask { + /** + * Specifies the isSystemTask property: The value of this property indicates whether the task resource is + * system task or not.. + * + * @param isSystemTask The value of this property indicates whether the task resource is system task or not. + * @return the next definition stage. + */ + WithCreate withIsSystemTask(Boolean isSystemTask); + } + } + /** + * Begins update for the Task resource. + * + * @return the stage of resource update. + */ + Task.Update update(); + + /** The template for Task update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithStatus, + UpdateStages.WithPlatform, + UpdateStages.WithAgentConfiguration, + UpdateStages.WithAgentPoolName, + UpdateStages.WithTimeout, + UpdateStages.WithStep, + UpdateStages.WithTrigger, + UpdateStages.WithCredentials, + UpdateStages.WithLogTemplate { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Task apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Task apply(Context context); + } + /** The Task update stages. */ + interface UpdateStages { + /** The stage of the Task update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The ARM resource tags.. + * + * @param tags The ARM resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Task update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity for the resource.. + * + * @param identity Identity for the resource. + * @return the next definition stage. + */ + Update withIdentity(IdentityProperties identity); + } + /** The stage of the Task update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The current status of task.. + * + * @param status The current status of task. + * @return the next definition stage. + */ + Update withStatus(TaskStatus status); + } + /** The stage of the Task update allowing to specify platform. */ + interface WithPlatform { + /** + * Specifies the platform property: The platform properties against which the run has to happen.. + * + * @param platform The platform properties against which the run has to happen. + * @return the next definition stage. + */ + Update withPlatform(PlatformUpdateParameters platform); + } + /** The stage of the Task update allowing to specify agentConfiguration. */ + interface WithAgentConfiguration { + /** + * Specifies the agentConfiguration property: The machine configuration of the run agent.. + * + * @param agentConfiguration The machine configuration of the run agent. + * @return the next definition stage. + */ + Update withAgentConfiguration(AgentProperties agentConfiguration); + } + /** The stage of the Task update allowing to specify agentPoolName. */ + interface WithAgentPoolName { + /** + * Specifies the agentPoolName property: The dedicated agent pool for the task.. + * + * @param agentPoolName The dedicated agent pool for the task. + * @return the next definition stage. + */ + Update withAgentPoolName(String agentPoolName); + } + /** The stage of the Task update allowing to specify timeout. */ + interface WithTimeout { + /** + * Specifies the timeout property: Run timeout in seconds.. + * + * @param timeout Run timeout in seconds. + * @return the next definition stage. + */ + Update withTimeout(Integer timeout); + } + /** The stage of the Task update allowing to specify step. */ + interface WithStep { + /** + * Specifies the step property: The properties for updating a task step.. + * + * @param step The properties for updating a task step. + * @return the next definition stage. + */ + Update withStep(TaskStepUpdateParameters step); + } + /** The stage of the Task update allowing to specify trigger. */ + interface WithTrigger { + /** + * Specifies the trigger property: The properties for updating trigger properties.. + * + * @param trigger The properties for updating trigger properties. + * @return the next definition stage. + */ + Update withTrigger(TriggerUpdateParameters trigger); + } + /** The stage of the Task update allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: The parameters that describes a set of credentials that will be used + * when this run is invoked.. + * + * @param credentials The parameters that describes a set of credentials that will be used when this run is + * invoked. + * @return the next definition stage. + */ + Update withCredentials(Credentials credentials); + } + /** The stage of the Task update allowing to specify logTemplate. */ + interface WithLogTemplate { + /** + * Specifies the logTemplate property: The template that describes the repository and tag information for + * run log artifact.. + * + * @param logTemplate The template that describes the repository and tag information for run log artifact. + * @return the next definition stage. + */ + Update withLogTemplate(String logTemplate); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Task refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Task refresh(Context context); + + /** + * Returns a task with extended information that includes all secrets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + Task getDetails(); + + /** + * Returns a task with extended information that includes all secrets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + Response getDetailsWithResponse(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskListResult.java new file mode 100644 index 0000000000000..f5571361a7873 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The collection of tasks. */ +@Fluent +public final class TaskListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskListResult.class); + + /* + * The collection value. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next set of paged results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The collection value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection value. + * + * @param value the value value to set. + * @return the TaskListResult object itself. + */ + public TaskListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next set of paged results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next set of paged results. + * + * @param nextLink the nextLink value to set. + * @return the TaskListResult object itself. + */ + public TaskListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRun.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRun.java new file mode 100644 index 0000000000000..74b0bab3e8a47 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRun.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskRunInner; +import java.util.Map; + +/** An immutable client-side representation of TaskRun. */ +public interface TaskRun { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the identity property: Identity for the resource. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the location property: The location of the resource. + * + * @return the location value. + */ + String location(); + + /** + * Gets the provisioningState property: The provisioning state of this task run. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the runRequest property: The request (parameters) for the run. + * + * @return the runRequest value. + */ + RunRequest runRequest(); + + /** + * Gets the runResult property: The result of this task run. + * + * @return the runResult value. + */ + Run runResult(); + + /** + * Gets the forceUpdateTag property: How the run should be forced to rerun even if the run request configuration has + * not changed. + * + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskRunInner object. + * + * @return the inner object. + */ + TaskRunInner innerModel(); + + /** The entirety of the TaskRun definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The TaskRun definition stages. */ + interface DefinitionStages { + /** The first stage of the TaskRun definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the TaskRun definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the TaskRun definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithIdentity, + DefinitionStages.WithRunRequest, + DefinitionStages.WithForceUpdateTag { + /** + * Executes the create request. + * + * @return the created resource. + */ + TaskRun create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TaskRun create(Context context); + } + /** The stage of the TaskRun definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the resource. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the resource. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the TaskRun definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity for the resource.. + * + * @param identity Identity for the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + /** The stage of the TaskRun definition allowing to specify runRequest. */ + interface WithRunRequest { + /** + * Specifies the runRequest property: The request (parameters) for the run. + * + * @param runRequest The request (parameters) for the run. + * @return the next definition stage. + */ + WithCreate withRunRequest(RunRequest runRequest); + } + /** The stage of the TaskRun definition allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the run should be forced to rerun even if the run request + * configuration has not changed. + * + * @param forceUpdateTag How the run should be forced to rerun even if the run request configuration has not + * changed. + * @return the next definition stage. + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + } + /** + * Begins update for the TaskRun resource. + * + * @return the stage of resource update. + */ + TaskRun.Update update(); + + /** The template for TaskRun update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithRunRequest, + UpdateStages.WithForceUpdateTag { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TaskRun apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TaskRun apply(Context context); + } + /** The TaskRun update stages. */ + interface UpdateStages { + /** The stage of the TaskRun update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The ARM resource tags.. + * + * @param tags The ARM resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the TaskRun update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity for the resource.. + * + * @param identity Identity for the resource. + * @return the next definition stage. + */ + Update withIdentity(IdentityProperties identity); + } + /** The stage of the TaskRun update allowing to specify runRequest. */ + interface WithRunRequest { + /** + * Specifies the runRequest property: The request (parameters) for the new run. + * + * @param runRequest The request (parameters) for the new run. + * @return the next definition stage. + */ + Update withRunRequest(RunRequest runRequest); + } + /** The stage of the TaskRun update allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the run should be forced to rerun even if the run request + * configuration has not changed. + * + * @param forceUpdateTag How the run should be forced to rerun even if the run request configuration has not + * changed. + * @return the next definition stage. + */ + Update withForceUpdateTag(String forceUpdateTag); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TaskRun refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TaskRun refresh(Context context); + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + TaskRun getDetails(); + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + Response getDetailsWithResponse(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunListResult.java new file mode 100644 index 0000000000000..614ea7452a8cd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskRunInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The collection of task runs. */ +@Fluent +public final class TaskRunListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskRunListResult.class); + + /* + * The collection value. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next set of paged results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The collection value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection value. + * + * @param value the value value to set. + * @return the TaskRunListResult object itself. + */ + public TaskRunListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next set of paged results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next set of paged results. + * + * @param nextLink the nextLink value to set. + * @return the TaskRunListResult object itself. + */ + public TaskRunListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunRequest.java new file mode 100644 index 0000000000000..3a01581e5a8aa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunRequest.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The parameters for a task run request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("TaskRunRequest") +@Fluent +public final class TaskRunRequest extends RunRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskRunRequest.class); + + /* + * The resource ID of task against which run has to be queued. + */ + @JsonProperty(value = "taskId", required = true) + private String taskId; + + /* + * Set of overridable parameters that can be passed when running a Task. + */ + @JsonProperty(value = "overrideTaskStepProperties") + private OverrideTaskStepProperties overrideTaskStepProperties; + + /** + * Get the taskId property: The resource ID of task against which run has to be queued. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: The resource ID of task against which run has to be queued. + * + * @param taskId the taskId value to set. + * @return the TaskRunRequest object itself. + */ + public TaskRunRequest withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the overrideTaskStepProperties property: Set of overridable parameters that can be passed when running a + * Task. + * + * @return the overrideTaskStepProperties value. + */ + public OverrideTaskStepProperties overrideTaskStepProperties() { + return this.overrideTaskStepProperties; + } + + /** + * Set the overrideTaskStepProperties property: Set of overridable parameters that can be passed when running a + * Task. + * + * @param overrideTaskStepProperties the overrideTaskStepProperties value to set. + * @return the TaskRunRequest object itself. + */ + public TaskRunRequest withOverrideTaskStepProperties(OverrideTaskStepProperties overrideTaskStepProperties) { + this.overrideTaskStepProperties = overrideTaskStepProperties; + return this; + } + + /** {@inheritDoc} */ + @Override + public TaskRunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { + super.withIsArchiveEnabled(isArchiveEnabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public TaskRunRequest withAgentPoolName(String agentPoolName) { + super.withAgentPoolName(agentPoolName); + return this; + } + + /** {@inheritDoc} */ + @Override + public TaskRunRequest withLogTemplate(String logTemplate) { + super.withLogTemplate(logTemplate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (taskId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property taskId in model TaskRunRequest")); + } + if (overrideTaskStepProperties() != null) { + overrideTaskStepProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunUpdateParameters.java new file mode 100644 index 0000000000000..270d148781350 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunUpdateParameters.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a task run. */ +@JsonFlatten +@Fluent +public class TaskRunUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskRunUpdateParameters.class); + + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The location of the resource + */ + @JsonProperty(value = "location") + private String location; + + /* + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The request (parameters) for the new run + */ + @JsonProperty(value = "properties.runRequest") + private RunRequest runRequest; + + /* + * How the run should be forced to rerun even if the run request + * configuration has not changed + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the TaskRunUpdateParameters object itself. + */ + public TaskRunUpdateParameters withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the location property: The location of the resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the resource. + * + * @param location the location value to set. + * @return the TaskRunUpdateParameters object itself. + */ + public TaskRunUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: The ARM resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The ARM resource tags. + * + * @param tags the tags value to set. + * @return the TaskRunUpdateParameters object itself. + */ + public TaskRunUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the runRequest property: The request (parameters) for the new run. + * + * @return the runRequest value. + */ + public RunRequest runRequest() { + return this.runRequest; + } + + /** + * Set the runRequest property: The request (parameters) for the new run. + * + * @param runRequest the runRequest value to set. + * @return the TaskRunUpdateParameters object itself. + */ + public TaskRunUpdateParameters withRunRequest(RunRequest runRequest) { + this.runRequest = runRequest; + return this; + } + + /** + * Get the forceUpdateTag property: How the run should be forced to rerun even if the run request configuration has + * not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the run should be forced to rerun even if the run request configuration has + * not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the TaskRunUpdateParameters object itself. + */ + public TaskRunUpdateParameters withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (runRequest() != null) { + runRequest().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRuns.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRuns.java new file mode 100644 index 0000000000000..2b2e3606c4d47 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRuns.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TaskRuns. */ +public interface TaskRuns { + /** + * Gets the detailed information for a given task run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + TaskRun get(String resourceGroupName, String registryName, String taskRunName); + + /** + * Gets the detailed information for a given task run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String taskRunName, Context context); + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String taskRunName); + + /** + * Deletes a specified task run resource. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String taskRunName, Context context); + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + TaskRun getDetails(String resourceGroupName, String registryName, String taskRunName); + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of the task run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + Response getDetailsWithResponse( + String resourceGroupName, String registryName, String taskRunName, Context context); + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the detailed information for a given task run. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + TaskRun getById(String id); + + /** + * Gets the detailed information for a given task run. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a specified task run resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a specified task run resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TaskRun resource. + * + * @param name resource name. + * @return the first stage of the new TaskRun definition. + */ + TaskRun.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStatus.java new file mode 100644 index 0000000000000..1f9f955c88072 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TaskStatus. */ +public final class TaskStatus extends ExpandableStringEnum { + /** Static value Disabled for TaskStatus. */ + public static final TaskStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for TaskStatus. */ + public static final TaskStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a TaskStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TaskStatus. + */ + @JsonCreator + public static TaskStatus fromString(String name) { + return fromString(name, TaskStatus.class); + } + + /** @return known TaskStatus values. */ + public static Collection values() { + return values(TaskStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStepProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStepProperties.java new file mode 100644 index 0000000000000..9821bd63fc7e1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStepProperties.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Base properties for any task step. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = TaskStepProperties.class) +@JsonTypeName("TaskStepProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "FileTask", value = FileTaskStep.class), + @JsonSubTypes.Type(name = "EncodedTask", value = EncodedTaskStep.class), + @JsonSubTypes.Type(name = "Docker", value = DockerTaskStep.class) +}) +@Fluent +public class TaskStepProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskStepProperties.class); + + /* + * List of base image dependencies for a step. + */ + @JsonProperty(value = "baseImageDependencies", access = JsonProperty.Access.WRITE_ONLY) + private List baseImageDependencies; + + /* + * The URL(absolute or relative) of the source context for the task step. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /* + * The token (git PAT or SAS token of storage account blob) associated with + * the context for a step. + */ + @JsonProperty(value = "contextAccessToken") + private String contextAccessToken; + + /** + * Get the baseImageDependencies property: List of base image dependencies for a step. + * + * @return the baseImageDependencies value. + */ + public List baseImageDependencies() { + return this.baseImageDependencies; + } + + /** + * Get the contextPath property: The URL(absolute or relative) of the source context for the task step. + * + * @return the contextPath value. + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the contextPath property: The URL(absolute or relative) of the source context for the task step. + * + * @param contextPath the contextPath value to set. + * @return the TaskStepProperties object itself. + */ + public TaskStepProperties withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the contextAccessToken property: The token (git PAT or SAS token of storage account blob) associated with the + * context for a step. + * + * @return the contextAccessToken value. + */ + public String contextAccessToken() { + return this.contextAccessToken; + } + + /** + * Set the contextAccessToken property: The token (git PAT or SAS token of storage account blob) associated with the + * context for a step. + * + * @param contextAccessToken the contextAccessToken value to set. + * @return the TaskStepProperties object itself. + */ + public TaskStepProperties withContextAccessToken(String contextAccessToken) { + this.contextAccessToken = contextAccessToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (baseImageDependencies() != null) { + baseImageDependencies().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStepUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStepUpdateParameters.java new file mode 100644 index 0000000000000..d98fe17059cda --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStepUpdateParameters.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base properties for updating any task step. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = TaskStepUpdateParameters.class) +@JsonTypeName("TaskStepUpdateParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Docker", value = DockerBuildStepUpdateParameters.class), + @JsonSubTypes.Type(name = "FileTask", value = FileTaskStepUpdateParameters.class), + @JsonSubTypes.Type(name = "EncodedTask", value = EncodedTaskStepUpdateParameters.class) +}) +@Fluent +public class TaskStepUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskStepUpdateParameters.class); + + /* + * The URL(absolute or relative) of the source context for the task step. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /* + * The token (git PAT or SAS token of storage account blob) associated with + * the context for a step. + */ + @JsonProperty(value = "contextAccessToken") + private String contextAccessToken; + + /** + * Get the contextPath property: The URL(absolute or relative) of the source context for the task step. + * + * @return the contextPath value. + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the contextPath property: The URL(absolute or relative) of the source context for the task step. + * + * @param contextPath the contextPath value to set. + * @return the TaskStepUpdateParameters object itself. + */ + public TaskStepUpdateParameters withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the contextAccessToken property: The token (git PAT or SAS token of storage account blob) associated with the + * context for a step. + * + * @return the contextAccessToken value. + */ + public String contextAccessToken() { + return this.contextAccessToken; + } + + /** + * Set the contextAccessToken property: The token (git PAT or SAS token of storage account blob) associated with the + * context for a step. + * + * @param contextAccessToken the contextAccessToken value to set. + * @return the TaskStepUpdateParameters object itself. + */ + public TaskStepUpdateParameters withContextAccessToken(String contextAccessToken) { + this.contextAccessToken = contextAccessToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskUpdateParameters.java new file mode 100644 index 0000000000000..c4d31b336f81f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskUpdateParameters.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a task. */ +@JsonFlatten +@Fluent +public class TaskUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskUpdateParameters.class); + + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The current status of task. + */ + @JsonProperty(value = "properties.status") + private TaskStatus status; + + /* + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "properties.platform") + private PlatformUpdateParameters platform; + + /* + * The machine configuration of the run agent. + */ + @JsonProperty(value = "properties.agentConfiguration") + private AgentProperties agentConfiguration; + + /* + * The dedicated agent pool for the task. + */ + @JsonProperty(value = "properties.agentPoolName") + private String agentPoolName; + + /* + * Run timeout in seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /* + * The properties for updating a task step. + */ + @JsonProperty(value = "properties.step") + private TaskStepUpdateParameters step; + + /* + * The properties for updating trigger properties. + */ + @JsonProperty(value = "properties.trigger") + private TriggerUpdateParameters trigger; + + /* + * The parameters that describes a set of credentials that will be used + * when this run is invoked. + */ + @JsonProperty(value = "properties.credentials") + private Credentials credentials; + + /* + * The template that describes the repository and tag information for run + * log artifact. + */ + @JsonProperty(value = "properties.logTemplate") + private String logTemplate; + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the tags property: The ARM resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The ARM resource tags. + * + * @param tags the tags value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the status property: The current status of task. + * + * @return the status value. + */ + public TaskStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of task. + * + * @param status the status value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withStatus(TaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the platform property: The platform properties against which the run has to happen. + * + * @return the platform value. + */ + public PlatformUpdateParameters platform() { + return this.platform; + } + + /** + * Set the platform property: The platform properties against which the run has to happen. + * + * @param platform the platform value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withPlatform(PlatformUpdateParameters platform) { + this.platform = platform; + return this; + } + + /** + * Get the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the agentConfiguration property: The machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the agentPoolName property: The dedicated agent pool for the task. + * + * @return the agentPoolName value. + */ + public String agentPoolName() { + return this.agentPoolName; + } + + /** + * Set the agentPoolName property: The dedicated agent pool for the task. + * + * @param agentPoolName the agentPoolName value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withAgentPoolName(String agentPoolName) { + this.agentPoolName = agentPoolName; + return this; + } + + /** + * Get the timeout property: Run timeout in seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: Run timeout in seconds. + * + * @param timeout the timeout value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the step property: The properties for updating a task step. + * + * @return the step value. + */ + public TaskStepUpdateParameters step() { + return this.step; + } + + /** + * Set the step property: The properties for updating a task step. + * + * @param step the step value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withStep(TaskStepUpdateParameters step) { + this.step = step; + return this; + } + + /** + * Get the trigger property: The properties for updating trigger properties. + * + * @return the trigger value. + */ + public TriggerUpdateParameters trigger() { + return this.trigger; + } + + /** + * Set the trigger property: The properties for updating trigger properties. + * + * @param trigger the trigger value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withTrigger(TriggerUpdateParameters trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the credentials property: The parameters that describes a set of credentials that will be used when this run + * is invoked. + * + * @return the credentials value. + */ + public Credentials credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The parameters that describes a set of credentials that will be used when this run + * is invoked. + * + * @param credentials the credentials value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withCredentials(Credentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the logTemplate property: The template that describes the repository and tag information for run log + * artifact. + * + * @return the logTemplate value. + */ + public String logTemplate() { + return this.logTemplate; + } + + /** + * Set the logTemplate property: The template that describes the repository and tag information for run log + * artifact. + * + * @param logTemplate the logTemplate value to set. + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withLogTemplate(String logTemplate) { + this.logTemplate = logTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (platform() != null) { + platform().validate(); + } + if (agentConfiguration() != null) { + agentConfiguration().validate(); + } + if (step() != null) { + step().validate(); + } + if (trigger() != null) { + trigger().validate(); + } + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tasks.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tasks.java new file mode 100644 index 0000000000000..ee9e26cf44014 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tasks.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Tasks. */ +public interface Tasks { + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of tasks. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + Task get(String resourceGroupName, String registryName, String taskName); + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + Response getWithResponse(String resourceGroupName, String registryName, String taskName, Context context); + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String taskName); + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String taskName, Context context); + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + Task getDetails(String resourceGroupName, String registryName, String taskName); + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + */ + Response getDetailsWithResponse( + String resourceGroupName, String registryName, String taskName, Context context); + + /** + * Get the properties of a specified task. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + Task getById(String id); + + /** + * Get the properties of a specified task. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a specified task. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a specified task. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a specified task. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Task resource. + * + * @param name resource name. + * @return the first stage of the new Task definition. + */ + Task.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTrigger.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTrigger.java new file mode 100644 index 0000000000000..4083a842b93b8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTrigger.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a timer trigger. */ +@Fluent +public final class TimerTrigger { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimerTrigger.class); + + /* + * The CRON expression for the task schedule + */ + @JsonProperty(value = "schedule", required = true) + private String schedule; + + /* + * The current status of trigger. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /* + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the schedule property: The CRON expression for the task schedule. + * + * @return the schedule value. + */ + public String schedule() { + return this.schedule; + } + + /** + * Set the schedule property: The CRON expression for the task schedule. + * + * @param schedule the schedule value to set. + * @return the TimerTrigger object itself. + */ + public TimerTrigger withSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the status property: The current status of trigger. + * + * @return the status value. + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of trigger. + * + * @param status the status value to set. + * @return the TimerTrigger object itself. + */ + public TimerTrigger withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name property: The name of the trigger. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the trigger. + * + * @param name the name value to set. + * @return the TimerTrigger object itself. + */ + public TimerTrigger withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (schedule() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property schedule in model TimerTrigger")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model TimerTrigger")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTriggerDescriptor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTriggerDescriptor.java new file mode 100644 index 0000000000000..ca1cf924a554c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTriggerDescriptor.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TimerTriggerDescriptor model. */ +@Fluent +public final class TimerTriggerDescriptor { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimerTriggerDescriptor.class); + + /* + * The timer trigger name that caused the run. + */ + @JsonProperty(value = "timerTriggerName") + private String timerTriggerName; + + /* + * The occurrence that triggered the run. + */ + @JsonProperty(value = "scheduleOccurrence") + private String scheduleOccurrence; + + /** + * Get the timerTriggerName property: The timer trigger name that caused the run. + * + * @return the timerTriggerName value. + */ + public String timerTriggerName() { + return this.timerTriggerName; + } + + /** + * Set the timerTriggerName property: The timer trigger name that caused the run. + * + * @param timerTriggerName the timerTriggerName value to set. + * @return the TimerTriggerDescriptor object itself. + */ + public TimerTriggerDescriptor withTimerTriggerName(String timerTriggerName) { + this.timerTriggerName = timerTriggerName; + return this; + } + + /** + * Get the scheduleOccurrence property: The occurrence that triggered the run. + * + * @return the scheduleOccurrence value. + */ + public String scheduleOccurrence() { + return this.scheduleOccurrence; + } + + /** + * Set the scheduleOccurrence property: The occurrence that triggered the run. + * + * @param scheduleOccurrence the scheduleOccurrence value to set. + * @return the TimerTriggerDescriptor object itself. + */ + public TimerTriggerDescriptor withScheduleOccurrence(String scheduleOccurrence) { + this.scheduleOccurrence = scheduleOccurrence; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTriggerUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTriggerUpdateParameters.java new file mode 100644 index 0000000000000..4e74d0c921617 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTriggerUpdateParameters.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties for updating a timer trigger. */ +@Fluent +public final class TimerTriggerUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimerTriggerUpdateParameters.class); + + /* + * The CRON expression for the task schedule + */ + @JsonProperty(value = "schedule") + private String schedule; + + /* + * The current status of trigger. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /* + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the schedule property: The CRON expression for the task schedule. + * + * @return the schedule value. + */ + public String schedule() { + return this.schedule; + } + + /** + * Set the schedule property: The CRON expression for the task schedule. + * + * @param schedule the schedule value to set. + * @return the TimerTriggerUpdateParameters object itself. + */ + public TimerTriggerUpdateParameters withSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the status property: The current status of trigger. + * + * @return the status value. + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of trigger. + * + * @param status the status value to set. + * @return the TimerTriggerUpdateParameters object itself. + */ + public TimerTriggerUpdateParameters withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name property: The name of the trigger. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the trigger. + * + * @param name the name value to set. + * @return the TimerTriggerUpdateParameters object itself. + */ + public TimerTriggerUpdateParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model TimerTriggerUpdateParameters")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsCertificateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsCertificateProperties.java new file mode 100644 index 0000000000000..bbbec5a33864e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsCertificateProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TLS certificate properties of the connected registry login server. */ +@Immutable +public final class TlsCertificateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TlsCertificateProperties.class); + + /* + * The type of certificate location. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private CertificateType type; + + /* + * Indicates the location of the certificates. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the type property: The type of certificate location. + * + * @return the type value. + */ + public CertificateType type() { + return this.type; + } + + /** + * Get the location property: Indicates the location of the certificates. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsProperties.java new file mode 100644 index 0000000000000..22d845023e311 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsProperties.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TLS properties of the connected registry login server. */ +@Immutable +public final class TlsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TlsProperties.class); + + /* + * Indicates whether HTTPS is enabled for the login server. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private TlsStatus status; + + /* + * The certificate used to configure HTTPS for the login server. + */ + @JsonProperty(value = "certificate", access = JsonProperty.Access.WRITE_ONLY) + private TlsCertificateProperties certificate; + + /** + * Get the status property: Indicates whether HTTPS is enabled for the login server. + * + * @return the status value. + */ + public TlsStatus status() { + return this.status; + } + + /** + * Get the certificate property: The certificate used to configure HTTPS for the login server. + * + * @return the certificate value. + */ + public TlsCertificateProperties certificate() { + return this.certificate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificate() != null) { + certificate().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsStatus.java new file mode 100644 index 0000000000000..2a0e1fc720473 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TlsStatus. */ +public final class TlsStatus extends ExpandableStringEnum { + /** Static value Enabled for TlsStatus. */ + public static final TlsStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for TlsStatus. */ + public static final TlsStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a TlsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TlsStatus. + */ + @JsonCreator + public static TlsStatus fromString(String name) { + return fromString(name, TlsStatus.class); + } + + /** @return known TlsStatus values. */ + public static Collection values() { + return values(TlsStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Token.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Token.java new file mode 100644 index 0000000000000..f19d1aa75fb2a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Token.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Token. */ +public interface Token { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @return the scopeMapId value. + */ + String scopeMapId(); + + /** + * Gets the credentials property: The credentials that can be used for authenticating the token. + * + * @return the credentials value. + */ + TokenCredentialsProperties credentials(); + + /** + * Gets the status property: The status of the token example enabled or disabled. + * + * @return the status value. + */ + TokenStatus status(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner object. + * + * @return the inner object. + */ + TokenInner innerModel(); + + /** The entirety of the Token definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Token definition stages. */ + interface DefinitionStages { + /** The first stage of the Token definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Token definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the Token definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithScopeMapId, DefinitionStages.WithCredentials, DefinitionStages.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + Token create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Token create(Context context); + } + /** The stage of the Token definition allowing to specify scopeMapId. */ + interface WithScopeMapId { + /** + * Specifies the scopeMapId property: The resource ID of the scope map to which the token will be associated + * with.. + * + * @param scopeMapId The resource ID of the scope map to which the token will be associated with. + * @return the next definition stage. + */ + WithCreate withScopeMapId(String scopeMapId); + } + /** The stage of the Token definition allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: The credentials that can be used for authenticating the token.. + * + * @param credentials The credentials that can be used for authenticating the token. + * @return the next definition stage. + */ + WithCreate withCredentials(TokenCredentialsProperties credentials); + } + /** The stage of the Token definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the token example enabled or disabled.. + * + * @param status The status of the token example enabled or disabled. + * @return the next definition stage. + */ + WithCreate withStatus(TokenStatus status); + } + } + /** + * Begins update for the Token resource. + * + * @return the stage of resource update. + */ + Token.Update update(); + + /** The template for Token update. */ + interface Update extends UpdateStages.WithScopeMapId, UpdateStages.WithStatus, UpdateStages.WithCredentials { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Token apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Token apply(Context context); + } + /** The Token update stages. */ + interface UpdateStages { + /** The stage of the Token update allowing to specify scopeMapId. */ + interface WithScopeMapId { + /** + * Specifies the scopeMapId property: The resource ID of the scope map to which the token will be associated + * with.. + * + * @param scopeMapId The resource ID of the scope map to which the token will be associated with. + * @return the next definition stage. + */ + Update withScopeMapId(String scopeMapId); + } + /** The stage of the Token update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the token example enabled or disabled.. + * + * @param status The status of the token example enabled or disabled. + * @return the next definition stage. + */ + Update withStatus(TokenStatus status); + } + /** The stage of the Token update allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: The credentials that can be used for authenticating the token.. + * + * @param credentials The credentials that can be used for authenticating the token. + * @return the next definition stage. + */ + Update withCredentials(TokenCredentialsProperties credentials); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Token refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Token refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificate.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificate.java new file mode 100644 index 0000000000000..6fd86d8437d98 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificate.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The properties of a certificate used for authenticating a token. */ +@Fluent +public final class TokenCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TokenCertificate.class); + + /* + * The name property. + */ + @JsonProperty(value = "name") + private TokenCertificateName name; + + /* + * The expiry datetime of the certificate. + */ + @JsonProperty(value = "expiry") + private OffsetDateTime expiry; + + /* + * The thumbprint of the certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /* + * Base 64 encoded string of the public certificate1 in PEM format that + * will be used for authenticating the token. + */ + @JsonProperty(value = "encodedPemCertificate") + private String encodedPemCertificate; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public TokenCertificateName name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the TokenCertificate object itself. + */ + public TokenCertificate withName(TokenCertificateName name) { + this.name = name; + return this; + } + + /** + * Get the expiry property: The expiry datetime of the certificate. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: The expiry datetime of the certificate. + * + * @param expiry the expiry value to set. + * @return the TokenCertificate object itself. + */ + public TokenCertificate withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get the thumbprint property: The thumbprint of the certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The thumbprint of the certificate. + * + * @param thumbprint the thumbprint value to set. + * @return the TokenCertificate object itself. + */ + public TokenCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the encodedPemCertificate property: Base 64 encoded string of the public certificate1 in PEM format that will + * be used for authenticating the token. + * + * @return the encodedPemCertificate value. + */ + public String encodedPemCertificate() { + return this.encodedPemCertificate; + } + + /** + * Set the encodedPemCertificate property: Base 64 encoded string of the public certificate1 in PEM format that will + * be used for authenticating the token. + * + * @param encodedPemCertificate the encodedPemCertificate value to set. + * @return the TokenCertificate object itself. + */ + public TokenCertificate withEncodedPemCertificate(String encodedPemCertificate) { + this.encodedPemCertificate = encodedPemCertificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificateName.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificateName.java new file mode 100644 index 0000000000000..e4cffd3f69042 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificateName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TokenCertificateName. */ +public final class TokenCertificateName extends ExpandableStringEnum { + /** Static value certificate1 for TokenCertificateName. */ + public static final TokenCertificateName CERTIFICATE1 = fromString("certificate1"); + + /** Static value certificate2 for TokenCertificateName. */ + public static final TokenCertificateName CERTIFICATE2 = fromString("certificate2"); + + /** + * Creates or finds a TokenCertificateName from its string representation. + * + * @param name a name to look for. + * @return the corresponding TokenCertificateName. + */ + @JsonCreator + public static TokenCertificateName fromString(String name) { + return fromString(name, TokenCertificateName.class); + } + + /** @return known TokenCertificateName values. */ + public static Collection values() { + return values(TokenCertificateName.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCredentialsProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCredentialsProperties.java new file mode 100644 index 0000000000000..6032e8fe8dfee --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCredentialsProperties.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of the credentials that can be used for authenticating the token. */ +@Fluent +public final class TokenCredentialsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TokenCredentialsProperties.class); + + /* + * The certificates property. + */ + @JsonProperty(value = "certificates") + private List certificates; + + /* + * The passwords property. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the certificates property: The certificates property. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: The certificates property. + * + * @param certificates the certificates value to set. + * @return the TokenCredentialsProperties object itself. + */ + public TokenCredentialsProperties withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get the passwords property: The passwords property. + * + * @return the passwords value. + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the passwords property: The passwords property. + * + * @param passwords the passwords value to set. + * @return the TokenCredentialsProperties object itself. + */ + public TokenCredentialsProperties withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificates() != null) { + certificates().forEach(e -> e.validate()); + } + if (passwords() != null) { + passwords().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenListResult.java new file mode 100644 index 0000000000000..15d04f7fd8324 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list tokens for a container registry. */ +@Fluent +public final class TokenListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TokenListResult.class); + + /* + * The list of tokens. Since this list may be incomplete, the nextLink + * field should be used to request the next list of tokens. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of tokens. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of tokens. Since this list may be incomplete, the nextLink field should be used + * to request the next list of tokens. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of tokens. Since this list may be incomplete, the nextLink field should be used + * to request the next list of tokens. + * + * @param value the value value to set. + * @return the TokenListResult object itself. + */ + public TokenListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of tokens. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of tokens. + * + * @param nextLink the nextLink value to set. + * @return the TokenListResult object itself. + */ + public TokenListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPassword.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPassword.java new file mode 100644 index 0000000000000..d672d1297eaa1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPassword.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The password that will be used for authenticating the token of a container registry. */ +@Fluent +public final class TokenPassword { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TokenPassword.class); + + /* + * The creation datetime of the password. + */ + @JsonProperty(value = "creationTime") + private OffsetDateTime creationTime; + + /* + * The expiry datetime of the password. + */ + @JsonProperty(value = "expiry") + private OffsetDateTime expiry; + + /* + * The password name "password1" or "password2" + */ + @JsonProperty(value = "name") + private TokenPasswordName name; + + /* + * The password value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the creationTime property: The creation datetime of the password. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: The creation datetime of the password. + * + * @param creationTime the creationTime value to set. + * @return the TokenPassword object itself. + */ + public TokenPassword withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get the expiry property: The expiry datetime of the password. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: The expiry datetime of the password. + * + * @param expiry the expiry value to set. + * @return the TokenPassword object itself. + */ + public TokenPassword withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get the name property: The password name "password1" or "password2". + * + * @return the name value. + */ + public TokenPasswordName name() { + return this.name; + } + + /** + * Set the name property: The password name "password1" or "password2". + * + * @param name the name value to set. + * @return the TokenPassword object itself. + */ + public TokenPassword withName(TokenPasswordName name) { + this.name = name; + return this; + } + + /** + * Get the value property: The password value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPasswordName.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPasswordName.java new file mode 100644 index 0000000000000..890cdc3e545a8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPasswordName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TokenPasswordName. */ +public final class TokenPasswordName extends ExpandableStringEnum { + /** Static value password1 for TokenPasswordName. */ + public static final TokenPasswordName PASSWORD1 = fromString("password1"); + + /** Static value password2 for TokenPasswordName. */ + public static final TokenPasswordName PASSWORD2 = fromString("password2"); + + /** + * Creates or finds a TokenPasswordName from its string representation. + * + * @param name a name to look for. + * @return the corresponding TokenPasswordName. + */ + @JsonCreator + public static TokenPasswordName fromString(String name) { + return fromString(name, TokenPasswordName.class); + } + + /** @return known TokenPasswordName values. */ + public static Collection values() { + return values(TokenPasswordName.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenStatus.java new file mode 100644 index 0000000000000..4d53dd97b0a17 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TokenStatus. */ +public final class TokenStatus extends ExpandableStringEnum { + /** Static value enabled for TokenStatus. */ + public static final TokenStatus ENABLED = fromString("enabled"); + + /** Static value disabled for TokenStatus. */ + public static final TokenStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a TokenStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TokenStatus. + */ + @JsonCreator + public static TokenStatus fromString(String name) { + return fromString(name, TokenStatus.class); + } + + /** @return known TokenStatus values. */ + public static Collection values() { + return values(TokenStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenType.java new file mode 100644 index 0000000000000..b78d0640fadf4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TokenType. */ +public final class TokenType extends ExpandableStringEnum { + /** Static value PAT for TokenType. */ + public static final TokenType PAT = fromString("PAT"); + + /** Static value OAuth for TokenType. */ + public static final TokenType OAUTH = fromString("OAuth"); + + /** + * Creates or finds a TokenType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TokenType. + */ + @JsonCreator + public static TokenType fromString(String name) { + return fromString(name, TokenType.class); + } + + /** @return known TokenType values. */ + public static Collection values() { + return values(TokenType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenUpdateParameters.java new file mode 100644 index 0000000000000..c64a707e79556 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenUpdateParameters.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating a token. */ +@JsonFlatten +@Fluent +public class TokenUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TokenUpdateParameters.class); + + /* + * The resource ID of the scope map to which the token will be associated + * with. + */ + @JsonProperty(value = "properties.scopeMapId") + private String scopeMapId; + + /* + * The status of the token example enabled or disabled. + */ + @JsonProperty(value = "properties.status") + private TokenStatus status; + + /* + * The credentials that can be used for authenticating the token. + */ + @JsonProperty(value = "properties.credentials") + private TokenCredentialsProperties credentials; + + /** + * Get the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @return the scopeMapId value. + */ + public String scopeMapId() { + return this.scopeMapId; + } + + /** + * Set the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @param scopeMapId the scopeMapId value to set. + * @return the TokenUpdateParameters object itself. + */ + public TokenUpdateParameters withScopeMapId(String scopeMapId) { + this.scopeMapId = scopeMapId; + return this; + } + + /** + * Get the status property: The status of the token example enabled or disabled. + * + * @return the status value. + */ + public TokenStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the token example enabled or disabled. + * + * @param status the status value to set. + * @return the TokenUpdateParameters object itself. + */ + public TokenUpdateParameters withStatus(TokenStatus status) { + this.status = status; + return this; + } + + /** + * Get the credentials property: The credentials that can be used for authenticating the token. + * + * @return the credentials value. + */ + public TokenCredentialsProperties credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials that can be used for authenticating the token. + * + * @param credentials the credentials value to set. + * @return the TokenUpdateParameters object itself. + */ + public TokenUpdateParameters withCredentials(TokenCredentialsProperties credentials) { + this.credentials = credentials; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tokens.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tokens.java new file mode 100644 index 0000000000000..bfc28c0463473 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tokens.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Tokens. */ +public interface Tokens { + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + Token get(String resourceGroupName, String registryName, String tokenName); + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + Response getWithResponse(String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String tokenName); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified token. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + Token getById(String id); + + /** + * Gets the properties of the specified token. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a token from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a token from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Token resource. + * + * @param name resource name. + * @return the first stage of the new Token definition. + */ + Token.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerProperties.java new file mode 100644 index 0000000000000..9e10029f3687e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerProperties.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a trigger. */ +@Fluent +public final class TriggerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggerProperties.class); + + /* + * The collection of timer triggers. + */ + @JsonProperty(value = "timerTriggers") + private List timerTriggers; + + /* + * The collection of triggers based on source code repository. + */ + @JsonProperty(value = "sourceTriggers") + private List sourceTriggers; + + /* + * The trigger based on base image dependencies. + */ + @JsonProperty(value = "baseImageTrigger") + private BaseImageTrigger baseImageTrigger; + + /** + * Get the timerTriggers property: The collection of timer triggers. + * + * @return the timerTriggers value. + */ + public List timerTriggers() { + return this.timerTriggers; + } + + /** + * Set the timerTriggers property: The collection of timer triggers. + * + * @param timerTriggers the timerTriggers value to set. + * @return the TriggerProperties object itself. + */ + public TriggerProperties withTimerTriggers(List timerTriggers) { + this.timerTriggers = timerTriggers; + return this; + } + + /** + * Get the sourceTriggers property: The collection of triggers based on source code repository. + * + * @return the sourceTriggers value. + */ + public List sourceTriggers() { + return this.sourceTriggers; + } + + /** + * Set the sourceTriggers property: The collection of triggers based on source code repository. + * + * @param sourceTriggers the sourceTriggers value to set. + * @return the TriggerProperties object itself. + */ + public TriggerProperties withSourceTriggers(List sourceTriggers) { + this.sourceTriggers = sourceTriggers; + return this; + } + + /** + * Get the baseImageTrigger property: The trigger based on base image dependencies. + * + * @return the baseImageTrigger value. + */ + public BaseImageTrigger baseImageTrigger() { + return this.baseImageTrigger; + } + + /** + * Set the baseImageTrigger property: The trigger based on base image dependencies. + * + * @param baseImageTrigger the baseImageTrigger value to set. + * @return the TriggerProperties object itself. + */ + public TriggerProperties withBaseImageTrigger(BaseImageTrigger baseImageTrigger) { + this.baseImageTrigger = baseImageTrigger; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timerTriggers() != null) { + timerTriggers().forEach(e -> e.validate()); + } + if (sourceTriggers() != null) { + sourceTriggers().forEach(e -> e.validate()); + } + if (baseImageTrigger() != null) { + baseImageTrigger().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerStatus.java new file mode 100644 index 0000000000000..fa1fb5ab2221e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TriggerStatus. */ +public final class TriggerStatus extends ExpandableStringEnum { + /** Static value Disabled for TriggerStatus. */ + public static final TriggerStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for TriggerStatus. */ + public static final TriggerStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a TriggerStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggerStatus. + */ + @JsonCreator + public static TriggerStatus fromString(String name) { + return fromString(name, TriggerStatus.class); + } + + /** @return known TriggerStatus values. */ + public static Collection values() { + return values(TriggerStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerUpdateParameters.java new file mode 100644 index 0000000000000..2143bc3f2a021 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerUpdateParameters.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties for updating triggers. */ +@Fluent +public final class TriggerUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggerUpdateParameters.class); + + /* + * The collection of timer triggers. + */ + @JsonProperty(value = "timerTriggers") + private List timerTriggers; + + /* + * The collection of triggers based on source code repository. + */ + @JsonProperty(value = "sourceTriggers") + private List sourceTriggers; + + /* + * The trigger based on base image dependencies. + */ + @JsonProperty(value = "baseImageTrigger") + private BaseImageTriggerUpdateParameters baseImageTrigger; + + /** + * Get the timerTriggers property: The collection of timer triggers. + * + * @return the timerTriggers value. + */ + public List timerTriggers() { + return this.timerTriggers; + } + + /** + * Set the timerTriggers property: The collection of timer triggers. + * + * @param timerTriggers the timerTriggers value to set. + * @return the TriggerUpdateParameters object itself. + */ + public TriggerUpdateParameters withTimerTriggers(List timerTriggers) { + this.timerTriggers = timerTriggers; + return this; + } + + /** + * Get the sourceTriggers property: The collection of triggers based on source code repository. + * + * @return the sourceTriggers value. + */ + public List sourceTriggers() { + return this.sourceTriggers; + } + + /** + * Set the sourceTriggers property: The collection of triggers based on source code repository. + * + * @param sourceTriggers the sourceTriggers value to set. + * @return the TriggerUpdateParameters object itself. + */ + public TriggerUpdateParameters withSourceTriggers(List sourceTriggers) { + this.sourceTriggers = sourceTriggers; + return this; + } + + /** + * Get the baseImageTrigger property: The trigger based on base image dependencies. + * + * @return the baseImageTrigger value. + */ + public BaseImageTriggerUpdateParameters baseImageTrigger() { + return this.baseImageTrigger; + } + + /** + * Set the baseImageTrigger property: The trigger based on base image dependencies. + * + * @param baseImageTrigger the baseImageTrigger value to set. + * @return the TriggerUpdateParameters object itself. + */ + public TriggerUpdateParameters withBaseImageTrigger(BaseImageTriggerUpdateParameters baseImageTrigger) { + this.baseImageTrigger = baseImageTrigger; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timerTriggers() != null) { + timerTriggers().forEach(e -> e.validate()); + } + if (sourceTriggers() != null) { + sourceTriggers().forEach(e -> e.validate()); + } + if (baseImageTrigger() != null) { + baseImageTrigger().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicy.java new file mode 100644 index 0000000000000..97c9105f3a9c1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicy.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The content trust policy for a container registry. */ +@Fluent +public final class TrustPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrustPolicy.class); + + /* + * The type of trust policy. + */ + @JsonProperty(value = "type") + private TrustPolicyType type; + + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the type property: The type of trust policy. + * + * @return the type value. + */ + public TrustPolicyType type() { + return this.type; + } + + /** + * Set the type property: The type of trust policy. + * + * @param type the type value to set. + * @return the TrustPolicy object itself. + */ + public TrustPolicy withType(TrustPolicyType type) { + this.type = type; + return this; + } + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The value that indicates whether the policy is enabled or not. + * + * @param status the status value to set. + * @return the TrustPolicy object itself. + */ + public TrustPolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicyType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicyType.java new file mode 100644 index 0000000000000..2841bd29e8fa8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicyType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TrustPolicyType. */ +public final class TrustPolicyType extends ExpandableStringEnum { + /** Static value Notary for TrustPolicyType. */ + public static final TrustPolicyType NOTARY = fromString("Notary"); + + /** + * Creates or finds a TrustPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrustPolicyType. + */ + @JsonCreator + public static TrustPolicyType fromString(String name) { + return fromString(name, TrustPolicyType.class); + } + + /** @return known TrustPolicyType values. */ + public static Collection values() { + return values(TrustPolicyType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UpdateTriggerPayloadType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UpdateTriggerPayloadType.java new file mode 100644 index 0000000000000..ac29f9533d1a0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UpdateTriggerPayloadType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UpdateTriggerPayloadType. */ +public final class UpdateTriggerPayloadType extends ExpandableStringEnum { + /** Static value Default for UpdateTriggerPayloadType. */ + public static final UpdateTriggerPayloadType DEFAULT = fromString("Default"); + + /** Static value Token for UpdateTriggerPayloadType. */ + public static final UpdateTriggerPayloadType TOKEN = fromString("Token"); + + /** + * Creates or finds a UpdateTriggerPayloadType from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateTriggerPayloadType. + */ + @JsonCreator + public static UpdateTriggerPayloadType fromString(String name) { + return fromString(name, UpdateTriggerPayloadType.class); + } + + /** @return known UpdateTriggerPayloadType values. */ + public static Collection values() { + return values(UpdateTriggerPayloadType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UserIdentityProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UserIdentityProperties.java new file mode 100644 index 0000000000000..2981b2d464c9f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UserIdentityProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserIdentityProperties model. */ +@Fluent +public final class UserIdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserIdentityProperties.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal id of user assigned identity. + * + * @param principalId the principalId value to set. + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client id of user assigned identity. + * + * @param clientId the clientId value to set. + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Variant.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Variant.java new file mode 100644 index 0000000000000..1e62c76d1975c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Variant.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Variant. */ +public final class Variant extends ExpandableStringEnum { + /** Static value v6 for Variant. */ + public static final Variant V6 = fromString("v6"); + + /** Static value v7 for Variant. */ + public static final Variant V7 = fromString("v7"); + + /** Static value v8 for Variant. */ + public static final Variant V8 = fromString("v8"); + + /** + * Creates or finds a Variant from its string representation. + * + * @param name a name to look for. + * @return the corresponding Variant. + */ + @JsonCreator + public static Variant fromString(String name) { + return fromString(name, Variant.class); + } + + /** @return known Variant values. */ + public static Collection values() { + return values(Variant.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/VirtualNetworkRule.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/VirtualNetworkRule.java new file mode 100644 index 0000000000000..87e5a5b100ae8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/VirtualNetworkRule.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual network rule. */ +@Fluent +public final class VirtualNetworkRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRule.class); + + /* + * The action of virtual network rule. + */ + @JsonProperty(value = "action") + private Action action; + + /* + * Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + */ + @JsonProperty(value = "id", required = true) + private String virtualNetworkResourceId; + + /** + * Get the action property: The action of virtual network rule. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of virtual network rule. + * + * @param action the action value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get the virtualNetworkResourceId property: Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @return the virtualNetworkResourceId value. + */ + public String virtualNetworkResourceId() { + return this.virtualNetworkResourceId; + } + + /** + * Set the virtualNetworkResourceId property: Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @param virtualNetworkResourceId the virtualNetworkResourceId value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkResourceId) { + this.virtualNetworkResourceId = virtualNetworkResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualNetworkResourceId in model VirtualNetworkRule")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhook.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhook.java new file mode 100644 index 0000000000000..622af5de177e9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhook.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Webhook. */ +public interface Webhook { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the status property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + WebhookStatus status(); + + /** + * Gets the scope property: 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. + */ + String scope(); + + /** + * Gets the actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the provisioningState property: The provisioning state of the webhook at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner object. + * + * @return the inner object. + */ + WebhookInner innerModel(); + + /** The entirety of the Webhook definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Webhook definition stages. */ + interface DefinitionStages { + /** The first stage of the Webhook definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Webhook definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the webhook. This cannot be changed after the resource is created. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the webhook. This cannot be changed after the resource is created. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Webhook definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the Webhook definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithServiceUri, + DefinitionStages.WithCustomHeaders, + DefinitionStages.WithStatus, + DefinitionStages.WithScope, + DefinitionStages.WithActions { + /** + * Executes the create request. + * + * @return the created resource. + */ + Webhook create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Webhook create(Context context); + } + /** The stage of the Webhook definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags for the webhook.. + * + * @param tags The tags for the webhook. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Webhook definition allowing to specify serviceUri. */ + interface WithServiceUri { + /** + * Specifies the serviceUri property: The service URI for the webhook to post notifications.. + * + * @param serviceUri The service URI for the webhook to post notifications. + * @return the next definition stage. + */ + WithCreate withServiceUri(String serviceUri); + } + /** The stage of the Webhook definition allowing to specify customHeaders. */ + interface WithCustomHeaders { + /** + * Specifies the customHeaders property: Custom headers that will be added to the webhook notifications.. + * + * @param customHeaders Custom headers that will be added to the webhook notifications. + * @return the next definition stage. + */ + WithCreate withCustomHeaders(Map customHeaders); + } + /** The stage of the Webhook definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the webhook at the time the operation was called.. + * + * @param status The status of the webhook at the time the operation was called. + * @return the next definition stage. + */ + WithCreate withStatus(WebhookStatus status); + } + /** The stage of the Webhook definition allowing to specify scope. */ + interface WithScope { + /** + * Specifies the scope property: 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 of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is + * equivalent to 'foo:latest'. Empty means all events. + * @return the next definition stage. + */ + WithCreate withScope(String scope); + } + /** The stage of the Webhook definition allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: The list of actions that trigger the webhook to post notifications.. + * + * @param actions The list of actions that trigger the webhook to post notifications. + * @return the next definition stage. + */ + WithCreate withActions(List actions); + } + } + /** + * Begins update for the Webhook resource. + * + * @return the stage of resource update. + */ + Webhook.Update update(); + + /** The template for Webhook update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithServiceUri, + UpdateStages.WithCustomHeaders, + UpdateStages.WithStatus, + UpdateStages.WithScope, + UpdateStages.WithActions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Webhook apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Webhook apply(Context context); + } + /** The Webhook update stages. */ + interface UpdateStages { + /** The stage of the Webhook update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags for the webhook.. + * + * @param tags The tags for the webhook. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Webhook update allowing to specify serviceUri. */ + interface WithServiceUri { + /** + * Specifies the serviceUri property: The service URI for the webhook to post notifications.. + * + * @param serviceUri The service URI for the webhook to post notifications. + * @return the next definition stage. + */ + Update withServiceUri(String serviceUri); + } + /** The stage of the Webhook update allowing to specify customHeaders. */ + interface WithCustomHeaders { + /** + * Specifies the customHeaders property: Custom headers that will be added to the webhook notifications.. + * + * @param customHeaders Custom headers that will be added to the webhook notifications. + * @return the next definition stage. + */ + Update withCustomHeaders(Map customHeaders); + } + /** The stage of the Webhook update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the webhook at the time the operation was called.. + * + * @param status The status of the webhook at the time the operation was called. + * @return the next definition stage. + */ + Update withStatus(WebhookStatus status); + } + /** The stage of the Webhook update allowing to specify scope. */ + interface WithScope { + /** + * Specifies the scope property: 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 of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is + * equivalent to 'foo:latest'. Empty means all events. + * @return the next definition stage. + */ + Update withScope(String scope); + } + /** The stage of the Webhook update allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: The list of actions that trigger the webhook to post notifications.. + * + * @param actions The list of actions that trigger the webhook to post notifications. + * @return the next definition stage. + */ + Update withActions(List actions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Webhook refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Webhook refresh(Context context); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + EventInfo ping(); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + Response pingWithResponse(Context context); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + CallbackConfig getCallbackConfig(); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + Response getCallbackConfigWithResponse(Context context); + + /** + * Lists recent events for the specified webhook. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + PagedIterable listEvents(); + + /** + * Lists recent events for the specified webhook. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + PagedIterable listEvents(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookAction.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookAction.java new file mode 100644 index 0000000000000..19109861200e1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookAction.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebhookAction. */ +public final class WebhookAction extends ExpandableStringEnum { + /** Static value push for WebhookAction. */ + public static final WebhookAction PUSH = fromString("push"); + + /** Static value delete for WebhookAction. */ + public static final WebhookAction DELETE = fromString("delete"); + + /** Static value quarantine for WebhookAction. */ + public static final WebhookAction QUARANTINE = fromString("quarantine"); + + /** Static value chart_push for WebhookAction. */ + public static final WebhookAction CHART_PUSH = fromString("chart_push"); + + /** Static value chart_delete for WebhookAction. */ + public static final WebhookAction CHART_DELETE = fromString("chart_delete"); + + /** + * Creates or finds a WebhookAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebhookAction. + */ + @JsonCreator + public static WebhookAction fromString(String name) { + return fromString(name, WebhookAction.class); + } + + /** @return known WebhookAction values. */ + public static Collection values() { + return values(WebhookAction.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookCreateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookCreateParameters.java new file mode 100644 index 0000000000000..d3110d350398d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookCreateParameters.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters for creating a webhook. */ +@JsonFlatten +@Fluent +public class WebhookCreateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebhookCreateParameters.class); + + /* + * 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") + 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. + */ + @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 property: The tags for the webhook. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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 property: 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 property: 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 serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the serviceUri property: 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 the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value. + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set the customHeaders property: 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 property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the webhook at the time the operation was called. + * + * @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 property: 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 property: 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 actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property location in model WebhookCreateParameters")); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookListResult.java new file mode 100644 index 0000000000000..51ae1d0ab1182 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list webhooks for a container registry. */ +@Fluent +public final class WebhookListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebhookListResult.class); + + /* + * The list of webhooks. Since this list may be incomplete, the nextLink + * field should be used to request the next list of webhooks. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of webhooks. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of webhooks. Since this list may be incomplete, the nextLink field should be + * used to request the next list of webhooks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of webhooks. Since this list may be incomplete, the nextLink field should be + * used to request the next list of webhooks. + * + * @param value the value value to set. + * @return the WebhookListResult object itself. + */ + public WebhookListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of webhooks. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of webhooks. + * + * @param nextLink the nextLink value to set. + * @return the WebhookListResult object itself. + */ + public WebhookListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookStatus.java new file mode 100644 index 0000000000000..05943ccff283d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebhookStatus. */ +public final class WebhookStatus extends ExpandableStringEnum { + /** Static value enabled for WebhookStatus. */ + public static final WebhookStatus ENABLED = fromString("enabled"); + + /** Static value disabled for WebhookStatus. */ + public static final WebhookStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a WebhookStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebhookStatus. + */ + @JsonCreator + public static WebhookStatus fromString(String name) { + return fromString(name, WebhookStatus.class); + } + + /** @return known WebhookStatus values. */ + public static Collection values() { + return values(WebhookStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookUpdateParameters.java new file mode 100644 index 0000000000000..384726d78f97d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookUpdateParameters.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters for updating a webhook. */ +@JsonFlatten +@Fluent +public class WebhookUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebhookUpdateParameters.class); + + /* + * 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. + */ + @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 property: The tags for the webhook. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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 serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the serviceUri property: 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 the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value. + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set the customHeaders property: 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 property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the webhook at the time the operation was called. + * + * @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 property: 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 property: 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 actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhooks.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhooks.java new file mode 100644 index 0000000000000..eb1f189f78c78 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhooks.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Webhooks. */ +public interface Webhooks { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + Webhook get(String resourceGroupName, String registryName, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String webhookName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + EventInfo ping(String resourceGroupName, String registryName, String webhookName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + CallbackConfig getCallbackConfig(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + Response getCallbackConfigWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + PagedIterable listEvents(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook. + */ + PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Gets the properties of the specified webhook. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + Webhook getById(String id); + + /** + * Gets the properties of the specified webhook. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a webhook from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a webhook from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Webhook resource. + * + * @param name resource name. + * @return the first stage of the new Webhook definition. + */ + Webhook.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ZoneRedundancy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ZoneRedundancy.java new file mode 100644 index 0000000000000..8e88e41e6b02d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ZoneRedundancy.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ZoneRedundancy. */ +public final class ZoneRedundancy extends ExpandableStringEnum { + /** Static value Enabled for ZoneRedundancy. */ + public static final ZoneRedundancy ENABLED = fromString("Enabled"); + + /** Static value Disabled for ZoneRedundancy. */ + public static final ZoneRedundancy DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ZoneRedundancy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ZoneRedundancy. + */ + @JsonCreator + public static ZoneRedundancy fromString(String name) { + return fromString(name, ZoneRedundancy.class); + } + + /** @return known ZoneRedundancy values. */ + public static Collection values() { + return values(ZoneRedundancy.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/package-info.java new file mode 100644 index 0000000000000..f8099cab9d16f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ContainerRegistryManagementClient. null. */ +package com.azure.resourcemanager.containerregistry.generated.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/package-info.java new file mode 100644 index 0000000000000..abf9e0c820133 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ContainerRegistryManagementClient. null. */ +package com.azure.resourcemanager.containerregistry.generated; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/module-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..929aeabe28fa5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.containerregistry.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.containerregistry.generated; + exports com.azure.resourcemanager.containerregistry.generated.fluent; + exports com.azure.resourcemanager.containerregistry.generated.fluent.models; + exports com.azure.resourcemanager.containerregistry.generated.models; + + opens com.azure.resourcemanager.containerregistry.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.containerregistry.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/containerregistry/ci.yml b/sdk/containerregistry/ci.yml index d443076933aad..36084e19f3c7c 100644 --- a/sdk/containerregistry/ci.yml +++ b/sdk/containerregistry/ci.yml @@ -39,3 +39,6 @@ extends: - name: azure-containers-containerregistry groupId: com.azure safeName: azurecontainerscontainerregistry + - name: azure-resourcemanager-containerregistry-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercontainerregistrygenerated diff --git a/sdk/containerregistry/pom.xml b/sdk/containerregistry/pom.xml index b93853b60ec62..cebaae642123d 100644 --- a/sdk/containerregistry/pom.xml +++ b/sdk/containerregistry/pom.xml @@ -51,6 +51,7 @@ azure-containers-containerregistry + azure-resourcemanager-containerregistry-generated