From 7812458f8a60eb7169551cb0aed965f20457ee06 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 29 Sep 2023 20:56:54 +0000 Subject: [PATCH] CodeGen from PR 25918 in Azure/azure-rest-api-specs Merge 4f14c56e9fb41c93de6feae6fe05a2f4d27406c5 into 116a843340e8b7127563997e7b280596d6c97654 --- eng/versioning/version_client.txt | 1 + .../CHANGELOG.md | 5 + .../README.md | 107 + .../SAMPLE.md | 3930 +++++++++++++++++ .../pom.xml | 62 + .../generated/ContainerRegistryManager.java | 573 +++ .../generated/fluent/AgentPoolsClient.java | 309 ++ .../fluent/ArchiveVersionsClient.java | 272 ++ .../generated/fluent/ArchivesClient.java | 276 ++ .../generated/fluent/CacheRulesClient.java | 288 ++ .../fluent/ConnectedRegistriesClient.java | 361 ++ .../ContainerRegistryManagementClient.java | 172 + .../fluent/CredentialSetsClient.java | 299 ++ .../fluent/ExportPipelinesClient.java | 216 + .../fluent/ImportPipelinesClient.java | 216 + .../generated/fluent/OperationsClient.java | 38 + .../generated/fluent/PipelineRunsClient.java | 214 + .../PrivateEndpointConnectionsClient.java | 218 + .../generated/fluent/RegistriesClient.java | 680 +++ .../generated/fluent/ReplicationsClient.java | 289 ++ .../generated/fluent/RunsClient.java | 240 + .../generated/fluent/ScopeMapsClient.java | 288 ++ .../generated/fluent/TaskRunsClient.java | 301 ++ .../generated/fluent/TasksClient.java | 309 ++ .../generated/fluent/TokensClient.java | 282 ++ .../generated/fluent/WebhooksClient.java | 388 ++ .../fluent/models/AgentPoolInner.java | 180 + .../fluent/models/AgentPoolProperties.java | 145 + .../AgentPoolPropertiesUpdateParameters.java | 50 + .../models/AgentPoolQueueStatusInner.java | 50 + .../generated/fluent/models/ArchiveInner.java | 148 + .../fluent/models/ArchiveProperties.java | 137 + .../models/ArchiveUpdateProperties.java | 50 + .../fluent/models/ArchiveVersionInner.java | 94 + .../models/ArchiveVersionProperties.java | 68 + .../fluent/models/CacheRuleInner.java | 152 + .../fluent/models/CacheRuleProperties.java | 139 + .../models/CacheRuleUpdateProperties.java | 52 + .../fluent/models/CallbackConfigInner.java | 87 + .../fluent/models/ConnectedRegistryInner.java | 267 ++ .../models/ConnectedRegistryProperties.java | 315 ++ .../ConnectedRegistryUpdateProperties.java | 141 + .../fluent/models/CredentialSetInner.java | 159 + .../models/CredentialSetProperties.java | 116 + .../models/CredentialSetUpdateProperties.java | 58 + .../fluent/models/EventInfoInner.java | 50 + .../generated/fluent/models/EventInner.java | 93 + .../fluent/models/ExportPipelineInner.java | 174 + .../models/ExportPipelineProperties.java | 105 + .../GenerateCredentialsResultInner.java | 81 + .../fluent/models/ImportPipelineInner.java | 198 + .../models/ImportPipelineProperties.java | 135 + .../models/OperationDefinitionInner.java | 179 + .../models/OperationPropertiesDefinition.java | 55 + .../fluent/models/PipelineRunInner.java | 128 + .../fluent/models/PipelineRunProperties.java | 117 + .../PrivateEndpointConnectionInner.java | 120 + .../PrivateEndpointConnectionProperties.java | 103 + .../models/PrivateLinkResourceInner.java | 179 + .../models/PrivateLinkResourceProperties.java | 103 + .../fluent/models/RegistryInner.java | 439 ++ .../RegistryListCredentialsResultInner.java | 81 + .../models/RegistryNameStatusInner.java | 104 + .../fluent/models/RegistryProperties.java | 403 ++ .../RegistryPropertiesUpdateParameters.java | 276 ++ .../models/RegistryUsageListResultInner.java | 55 + .../fluent/models/ReplicationInner.java | 148 + .../fluent/models/ReplicationProperties.java | 120 + ...ReplicationUpdateParametersProperties.java | 55 + .../fluent/models/RunGetLogResultInner.java | 76 + .../generated/fluent/models/RunInner.java | 554 +++ .../fluent/models/RunProperties.java | 613 +++ .../fluent/models/ScopeMapInner.java | 137 + .../fluent/models/ScopeMapProperties.java | 136 + .../ScopeMapPropertiesUpdateParameters.java | 81 + .../models/SourceUploadDefinitionInner.java | 78 + .../generated/fluent/models/TaskInner.java | 369 ++ .../fluent/models/TaskProperties.java | 343 ++ .../TaskPropertiesUpdateParameters.java | 283 ++ .../generated/fluent/models/TaskRunInner.java | 187 + .../fluent/models/TaskRunPropertiesInner.java | 116 + .../TaskRunPropertiesUpdateParameters.java | 82 + .../generated/fluent/models/TokenInner.java | 150 + .../fluent/models/TokenProperties.java | 139 + .../fluent/models/TokenUpdateProperties.java | 107 + .../generated/fluent/models/WebhookInner.java | 160 + .../fluent/models/WebhookProperties.java | 135 + .../WebhookPropertiesCreateParameters.java | 181 + .../WebhookPropertiesUpdateParameters.java | 166 + .../generated/fluent/models/package-info.java | 6 + .../generated/fluent/package-info.java | 6 + .../implementation/AgentPoolImpl.java | 244 + .../AgentPoolQueueStatusImpl.java | 33 + .../implementation/AgentPoolsClientImpl.java | 1636 +++++++ .../implementation/AgentPoolsImpl.java | 215 + .../generated/implementation/ArchiveImpl.java | 196 + .../implementation/ArchiveVersionImpl.java | 55 + .../ArchiveVersionsClientImpl.java | 1359 ++++++ .../implementation/ArchiveVersionsImpl.java | 144 + .../implementation/ArchivesClientImpl.java | 1466 ++++++ .../implementation/ArchivesImpl.java | 219 + .../implementation/CacheRuleImpl.java | 183 + .../implementation/CacheRulesClientImpl.java | 1480 +++++++ .../implementation/CacheRulesImpl.java | 188 + .../implementation/CallbackConfigImpl.java | 44 + .../ConnectedRegistriesClientImpl.java | 1859 ++++++++ .../ConnectedRegistriesImpl.java | 207 + .../implementation/ConnectedRegistryImpl.java | 287 ++ ...tainerRegistryManagementClientBuilder.java | 144 + ...ContainerRegistryManagementClientImpl.java | 529 +++ .../implementation/CredentialSetImpl.java | 203 + .../CredentialSetsClientImpl.java | 1524 +++++++ .../implementation/CredentialSetsImpl.java | 192 + .../generated/implementation/EventImpl.java | 43 + .../implementation/EventInfoImpl.java | 33 + .../implementation/ExportPipelineImpl.java | 169 + .../ExportPipelinesClientImpl.java | 1163 +++++ .../implementation/ExportPipelinesImpl.java | 192 + .../GenerateCredentialsResultImpl.java | 45 + .../implementation/ImportPipelineImpl.java | 179 + .../ImportPipelinesClientImpl.java | 1163 +++++ .../implementation/ImportPipelinesImpl.java | 192 + .../OperationDefinitionImpl.java | 51 + .../implementation/OperationsClientImpl.java | 277 ++ .../implementation/OperationsImpl.java | 46 + .../implementation/PipelineRunImpl.java | 133 + .../PipelineRunsClientImpl.java | 1154 +++++ .../implementation/PipelineRunsImpl.java | 188 + .../PrivateEndpointConnectionImpl.java | 164 + .../PrivateEndpointConnectionsClientImpl.java | 1193 +++++ .../PrivateEndpointConnectionsImpl.java | 210 + .../PrivateLinkResourceImpl.java | 65 + .../implementation/RegistriesClientImpl.java | 3752 ++++++++++++++++ .../implementation/RegistriesImpl.java | 413 ++ .../implementation/RegistryImpl.java | 469 ++ .../RegistryListCredentialsResultImpl.java | 45 + .../RegistryNameStatusImpl.java | 41 + .../RegistryUsageListResultImpl.java | 41 + .../implementation/ReplicationImpl.java | 220 + .../ReplicationsClientImpl.java | 1482 +++++++ .../implementation/ReplicationsImpl.java | 188 + .../implementation/RunGetLogResultImpl.java | 37 + .../generated/implementation/RunImpl.java | 156 + .../implementation/RunsClientImpl.java | 1324 ++++++ .../generated/implementation/RunsImpl.java | 133 + .../implementation/ScopeMapImpl.java | 190 + .../implementation/ScopeMapsClientImpl.java | 1476 +++++++ .../implementation/ScopeMapsImpl.java | 188 + .../SourceUploadDefinitionImpl.java | 37 + .../generated/implementation/TaskImpl.java | 363 ++ .../generated/implementation/TaskRunImpl.java | 239 + .../implementation/TaskRunPropertiesImpl.java | 54 + .../implementation/TaskRunsClientImpl.java | 1587 +++++++ .../implementation/TaskRunsImpl.java | 212 + .../implementation/TasksClientImpl.java | 1608 +++++++ .../generated/implementation/TasksImpl.java | 212 + .../generated/implementation/TokenImpl.java | 195 + .../implementation/TokensClientImpl.java | 1443 ++++++ .../generated/implementation/TokensImpl.java | 188 + .../generated/implementation/Utils.java | 204 + .../generated/implementation/WebhookImpl.java | 295 ++ .../implementation/WebhooksClientImpl.java | 2128 +++++++++ .../implementation/WebhooksImpl.java | 255 ++ .../implementation/package-info.java | 6 + .../generated/models/Action.java | 44 + .../generated/models/ActionsRequired.java | 47 + .../models/ActivationProperties.java | 39 + .../generated/models/ActivationStatus.java | 47 + .../generated/models/Actor.java | 52 + .../generated/models/AgentPool.java | 333 ++ .../generated/models/AgentPoolListResult.java | 81 + .../models/AgentPoolQueueStatus.java | 25 + .../models/AgentPoolUpdateParameters.java | 95 + .../generated/models/AgentPools.java | 170 + .../generated/models/AgentProperties.java | 50 + .../generated/models/Architecture.java | 56 + .../generated/models/Archive.java | 225 + .../generated/models/ArchiveListResult.java | 84 + .../ArchivePackageSourceProperties.java | 76 + .../models/ArchiveUpdateParameters.java | 66 + .../generated/models/ArchiveVersion.java | 61 + .../models/ArchiveVersionListResult.java | 84 + .../generated/models/ArchiveVersions.java | 169 + .../generated/models/Archives.java | 150 + .../generated/models/Argument.java | 115 + .../generated/models/AuditLogStatus.java | 47 + .../generated/models/AuthCredential.java | 120 + .../generated/models/AuthInfo.java | 166 + .../models/AuthInfoUpdateParameters.java | 154 + .../AzureADAuthenticationAsArmPolicy.java | 50 + ...zureADAuthenticationAsArmPolicyStatus.java | 48 + .../generated/models/BaseImageDependency.java | 154 + .../models/BaseImageDependencyType.java | 47 + .../generated/models/BaseImageTrigger.java | 168 + .../models/BaseImageTriggerType.java | 47 + .../BaseImageTriggerUpdateParameters.java | 164 + .../generated/models/CacheRule.java | 233 + .../models/CacheRuleUpdateParameters.java | 68 + .../generated/models/CacheRules.java | 144 + .../models/CacheRulesListResult.java | 81 + .../generated/models/CallbackConfig.java | 32 + .../generated/models/CertificateType.java | 44 + .../generated/models/ConnectedRegistries.java | 173 + .../generated/models/ConnectedRegistry.java | 376 ++ .../models/ConnectedRegistryListResult.java | 84 + .../models/ConnectedRegistryMode.java | 53 + .../ConnectedRegistryUpdateParameters.java | 140 + .../generated/models/ConnectionState.java | 53 + .../generated/models/ConnectionStatus.java | 53 + .../generated/models/CredentialHealth.java | 102 + .../models/CredentialHealthStatus.java | 47 + .../generated/models/CredentialName.java | 44 + .../generated/models/CredentialSet.java | 244 + .../models/CredentialSetListResult.java | 84 + .../models/CredentialSetUpdateParameters.java | 98 + .../generated/models/CredentialSets.java | 144 + .../generated/models/Credentials.java | 98 + .../models/CustomRegistryCredentials.java | 123 + .../DebianArchivePackageSourceProperties.java | 66 + .../models/DebianArchiveProperties.java | 74 + .../generated/models/DefaultAction.java | 47 + .../generated/models/DockerBuildRequest.java | 372 ++ .../DockerBuildStepUpdateParameters.java | 206 + .../generated/models/DockerTaskStep.java | 214 + .../models/EncodedTaskRunRequest.java | 292 ++ .../generated/models/EncodedTaskStep.java | 135 + .../EncodedTaskStepUpdateParameters.java | 126 + .../generated/models/EncryptionProperty.java | 79 + .../generated/models/EncryptionStatus.java | 47 + .../generated/models/Event.java | 38 + .../generated/models/EventContent.java | 225 + .../generated/models/EventInfo.java | 24 + .../generated/models/EventListResult.java | 84 + .../generated/models/EventRequestMessage.java | 160 + .../models/EventResponseMessage.java | 157 + .../generated/models/ExportPipeline.java | 214 + .../models/ExportPipelineListResult.java | 84 + .../ExportPipelineTargetProperties.java | 117 + .../generated/models/ExportPipelines.java | 144 + .../generated/models/ExportPolicy.java | 50 + .../generated/models/ExportPolicyStatus.java | 47 + .../generated/models/FileTaskRunRequest.java | 291 ++ .../generated/models/FileTaskStep.java | 134 + .../models/FileTaskStepUpdateParameters.java | 126 + .../models/GenerateCredentialsParameters.java | 105 + .../models/GenerateCredentialsResult.java | 33 + .../generated/models/IdentityProperties.java | 128 + .../generated/models/ImageDescriptor.java | 128 + .../generated/models/ImageUpdateTrigger.java | 107 + .../models/ImportImageParameters.java | 147 + .../generated/models/ImportMode.java | 50 + .../generated/models/ImportPipeline.java | 233 + .../models/ImportPipelineListResult.java | 84 + .../ImportPipelineSourceProperties.java | 117 + .../generated/models/ImportPipelines.java | 144 + .../generated/models/ImportSource.java | 146 + .../models/ImportSourceCredentials.java | 85 + .../generated/models/IpRule.java | 84 + .../generated/models/KeyVaultProperties.java | 123 + .../generated/models/LogLevel.java | 56 + .../generated/models/LoggingProperties.java | 76 + .../models/LoginServerProperties.java | 57 + .../generated/models/MetadataSearch.java | 47 + .../models/NetworkRuleBypassOptions.java | 47 + .../generated/models/NetworkRuleSet.java | 88 + .../generated/models/OS.java | 47 + .../generated/models/OperationDefinition.java | 54 + .../models/OperationDisplayDefinition.java | 128 + .../generated/models/OperationListResult.java | 84 + .../OperationLogSpecificationDefinition.java | 102 + ...perationMetricSpecificationDefinition.java | 180 + ...erationServiceSpecificationDefinition.java | 85 + .../generated/models/Operations.java | 33 + .../models/OverrideTaskStepProperties.java | 192 + .../generated/models/PackageSourceType.java | 44 + .../generated/models/ParentProperties.java | 86 + .../generated/models/PasswordName.java | 51 + .../generated/models/PipelineOptions.java | 53 + .../generated/models/PipelineRun.java | 160 + .../models/PipelineRunListResult.java | 84 + .../generated/models/PipelineRunRequest.java | 168 + .../generated/models/PipelineRunResponse.java | 298 ++ .../models/PipelineRunSourceProperties.java | 76 + .../models/PipelineRunSourceType.java | 44 + .../models/PipelineRunTargetProperties.java | 76 + .../models/PipelineRunTargetType.java | 44 + .../generated/models/PipelineRuns.java | 144 + .../PipelineSourceTriggerDescriptor.java | 51 + .../PipelineSourceTriggerProperties.java | 59 + .../generated/models/PipelineSourceType.java | 44 + .../models/PipelineTriggerDescriptor.java | 53 + .../models/PipelineTriggerProperties.java | 53 + .../generated/models/PlatformProperties.java | 110 + .../models/PlatformUpdateParameters.java | 102 + .../generated/models/Policies.java | 201 + .../generated/models/PolicyStatus.java | 47 + .../generated/models/PrivateEndpoint.java | 50 + .../models/PrivateEndpointConnection.java | 218 + .../PrivateEndpointConnectionListResult.java | 84 + .../models/PrivateEndpointConnections.java | 147 + .../generated/models/PrivateLinkResource.java | 61 + .../models/PrivateLinkResourceListResult.java | 84 + .../PrivateLinkServiceConnectionState.java | 107 + .../generated/models/ProgressProperties.java | 50 + .../generated/models/ProvisioningState.java | 59 + .../generated/models/PublicNetworkAccess.java | 47 + .../generated/models/QuarantinePolicy.java | 50 + .../RegenerateCredentialParameters.java | 59 + .../generated/models/Registries.java | 434 ++ .../generated/models/Registry.java | 769 ++++ .../models/RegistryListCredentialsResult.java | 33 + .../generated/models/RegistryListResult.java | 84 + .../models/RegistryNameCheckRequest.java | 87 + .../generated/models/RegistryNameStatus.java | 40 + .../generated/models/RegistryPassword.java | 76 + .../models/RegistryUpdateParameters.java | 339 ++ .../generated/models/RegistryUsage.java | 128 + .../models/RegistryUsageListResult.java | 26 + .../generated/models/RegistryUsageUnit.java | 47 + .../generated/models/Replication.java | 293 ++ .../models/ReplicationListResult.java | 84 + .../models/ReplicationUpdateParameters.java | 99 + .../generated/models/Replications.java | 144 + .../generated/models/Request.java | 160 + .../models/ResourceIdentityType.java | 57 + .../generated/models/RetentionPolicy.java | 92 + .../generated/models/Run.java | 205 + .../generated/models/RunGetLogResult.java | 31 + .../generated/models/RunListResult.java | 81 + .../generated/models/RunRequest.java | 119 + .../generated/models/RunStatus.java | 65 + .../generated/models/RunType.java | 53 + .../generated/models/RunUpdateParameters.java | 50 + .../generated/models/Runs.java | 154 + .../generated/models/ScopeMap.java | 228 + .../generated/models/ScopeMapListResult.java | 84 + .../models/ScopeMapUpdateParameters.java | 92 + .../generated/models/ScopeMaps.java | 144 + .../generated/models/SecretObject.java | 83 + .../generated/models/SecretObjectType.java | 47 + .../generated/models/SetValue.java | 113 + .../generated/models/Sku.java | 72 + .../generated/models/SkuName.java | 53 + .../generated/models/SkuTier.java | 53 + .../generated/models/SoftDeletePolicy.java | 92 + .../generated/models/Source.java | 82 + .../generated/models/SourceControlType.java | 47 + .../generated/models/SourceProperties.java | 148 + .../models/SourceRegistryCredentials.java | 57 + .../models/SourceRegistryLoginMode.java | 51 + .../generated/models/SourceTrigger.java | 150 + .../models/SourceTriggerDescriptor.java | 206 + .../generated/models/SourceTriggerEvent.java | 47 + .../models/SourceTriggerUpdateParameters.java | 141 + .../models/SourceUpdateParameters.java | 135 + .../models/SourceUploadDefinition.java | 33 + .../generated/models/Status.java | 70 + .../models/StatusDetailProperties.java | 100 + .../generated/models/StepType.java | 50 + .../generated/models/SyncProperties.java | 184 + .../models/SyncUpdateProperties.java | 111 + .../generated/models/Target.java | 258 ++ .../generated/models/Task.java | 593 +++ .../generated/models/TaskListResult.java | 81 + .../generated/models/TaskRun.java | 330 ++ .../generated/models/TaskRunListResult.java | 81 + .../generated/models/TaskRunProperties.java | 46 + .../generated/models/TaskRunRequest.java | 116 + .../models/TaskRunUpdateParameters.java | 175 + .../generated/models/TaskRuns.java | 170 + .../generated/models/TaskStatus.java | 47 + .../generated/models/TaskStepProperties.java | 111 + .../models/TaskStepUpdateParameters.java | 92 + .../models/TaskUpdateParameters.java | 312 ++ .../generated/models/Tasks.java | 169 + .../generated/models/TimerTrigger.java | 115 + .../models/TimerTriggerDescriptor.java | 76 + .../models/TimerTriggerUpdateParameters.java | 111 + .../models/TlsCertificateProperties.java | 54 + .../generated/models/TlsProperties.java | 57 + .../generated/models/TlsStatus.java | 47 + .../generated/models/Token.java | 247 ++ .../generated/models/TokenCertificate.java | 131 + .../models/TokenCertificateName.java | 47 + .../models/TokenCredentialsProperties.java | 83 + .../generated/models/TokenListResult.java | 84 + .../generated/models/TokenPassword.java | 118 + .../generated/models/TokenPasswordName.java | 47 + .../generated/models/TokenStatus.java | 47 + .../generated/models/TokenType.java | 47 + .../models/TokenUpdateParameters.java | 112 + .../generated/models/Tokens.java | 143 + .../generated/models/TriggerProperties.java | 112 + .../generated/models/TriggerStatus.java | 47 + .../models/TriggerUpdateParameters.java | 112 + .../generated/models/TrustPolicy.java | 76 + .../generated/models/TrustPolicyType.java | 44 + .../models/UpdateTriggerPayloadType.java | 47 + .../models/UserIdentityProperties.java | 54 + .../generated/models/Variant.java | 50 + .../generated/models/Webhook.java | 439 ++ .../generated/models/WebhookAction.java | 56 + .../models/WebhookCreateParameters.java | 227 + .../generated/models/WebhookListResult.java | 84 + .../generated/models/WebhookStatus.java | 47 + .../models/WebhookUpdateParameters.java | 192 + .../generated/models/Webhooks.java | 227 + .../generated/models/ZoneRedundancy.java | 47 + .../generated/models/package-info.java | 6 + .../generated/package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../generated/AgentPoolsCreateSamples.java | 46 + .../generated/AgentPoolsDeleteSamples.java | 21 + .../AgentPoolsGetQueueStatusSamples.java | 24 + .../generated/AgentPoolsGetSamples.java | 23 + .../generated/AgentPoolsListSamples.java | 21 + .../generated/AgentPoolsUpdateSamples.java | 28 + .../ArchiveVersionsCreateSamples.java | 29 + .../ArchiveVersionsDeleteSamples.java | 29 + .../generated/ArchiveVersionsGetSamples.java | 29 + .../generated/ArchiveVersionsListSamples.java | 23 + .../generated/ArchivesCreateSamples.java | 32 + .../generated/ArchivesDeleteSamples.java | 24 + .../generated/ArchivesGetSamples.java | 24 + .../generated/ArchivesListSamples.java | 21 + .../generated/ArchivesUpdateSamples.java | 29 + .../generated/CacheRulesCreateSamples.java | 29 + .../generated/CacheRulesDeleteSamples.java | 21 + .../generated/CacheRulesGetSamples.java | 23 + .../generated/CacheRulesListSamples.java | 21 + .../generated/CacheRulesUpdateSamples.java | 32 + .../ConnectedRegistriesCreateSamples.java | 45 + .../ConnectedRegistriesDeactivateSamples.java | 23 + .../ConnectedRegistriesDeleteSamples.java | 23 + .../ConnectedRegistriesGetSamples.java | 23 + .../ConnectedRegistriesListSamples.java | 21 + .../ConnectedRegistriesUpdateSamples.java | 49 + .../CredentialSetsCreateSamples.java | 40 + .../CredentialSetsDeleteSamples.java | 23 + .../generated/CredentialSetsGetSamples.java | 23 + .../generated/CredentialSetsListSamples.java | 21 + .../CredentialSetsUpdateSamples.java | 40 + .../ExportPipelinesCreateSamples.java | 39 + .../ExportPipelinesDeleteSamples.java | 23 + .../generated/ExportPipelinesGetSamples.java | 23 + .../generated/ExportPipelinesListSamples.java | 21 + .../ImportPipelinesCreateSamples.java | 66 + .../ImportPipelinesDeleteSamples.java | 23 + .../generated/ImportPipelinesGetSamples.java | 23 + .../generated/ImportPipelinesListSamples.java | 21 + .../generated/OperationsListSamples.java | 21 + .../generated/PipelineRunsCreateSamples.java | 72 + .../generated/PipelineRunsDeleteSamples.java | 23 + .../generated/PipelineRunsGetSamples.java | 23 + .../generated/PipelineRunsListSamples.java | 21 + ...pointConnectionsCreateOrUpdateSamples.java | 32 + ...ivateEndpointConnectionsDeleteSamples.java | 23 + .../PrivateEndpointConnectionsGetSamples.java | 23 + ...PrivateEndpointConnectionsListSamples.java | 21 + ...egistriesCheckNameAvailabilitySamples.java | 42 + .../generated/RegistriesCreateSamples.java | 68 + .../generated/RegistriesDeleteSamples.java | 21 + .../RegistriesGenerateCredentialsSamples.java | 32 + ...istriesGetBuildSourceUploadUrlSamples.java | 23 + .../RegistriesGetByResourceGroupSamples.java | 23 + ...gistriesGetPrivateLinkResourceSamples.java | 24 + .../RegistriesImportImageSamples.java | 94 + .../RegistriesListByResourceGroupSamples.java | 21 + .../RegistriesListCredentialsSamples.java | 23 + ...striesListPrivateLinkResourcesSamples.java | 23 + .../generated/RegistriesListSamples.java | 21 + .../RegistriesListUsagesSamples.java | 21 + ...RegistriesRegenerateCredentialSamples.java | 30 + .../RegistriesScheduleRunSamples.java | 321 ++ .../generated/RegistriesUpdateSamples.java | 49 + .../generated/ReplicationsCreateSamples.java | 64 + .../generated/ReplicationsDeleteSamples.java | 23 + .../generated/ReplicationsGetSamples.java | 23 + .../generated/ReplicationsListSamples.java | 21 + .../generated/ReplicationsUpdateSamples.java | 42 + .../generated/RunsCancelSamples.java | 27 + .../generated/RunsGetLogSasUrlSamples.java | 27 + .../generated/generated/RunsGetSamples.java | 26 + .../generated/generated/RunsListSamples.java | 21 + .../generated/RunsUpdateSamples.java | 30 + .../generated/ScopeMapsCreateSamples.java | 29 + .../generated/ScopeMapsDeleteSamples.java | 21 + .../generated/ScopeMapsGetSamples.java | 23 + .../generated/ScopeMapsListSamples.java | 21 + .../generated/ScopeMapsUpdateSamples.java | 34 + .../generated/TaskRunsCreateSamples.java | 40 + .../generated/TaskRunsDeleteSamples.java | 21 + .../generated/TaskRunsGetDetailsSamples.java | 23 + .../generated/TaskRunsGetSamples.java | 21 + .../generated/TaskRunsListSamples.java | 21 + .../generated/TaskRunsUpdateSamples.java | 45 + .../generated/TasksCreateSamples.java | 336 ++ .../generated/TasksDeleteSamples.java | 21 + .../generated/TasksGetDetailsSamples.java | 23 + .../generated/generated/TasksGetSamples.java | 21 + .../generated/generated/TasksListSamples.java | 21 + .../generated/TasksUpdateSamples.java | 267 ++ .../generated/TokensCreateSamples.java | 42 + .../generated/TokensDeleteSamples.java | 21 + .../generated/generated/TokensGetSamples.java | 21 + .../generated/TokensListSamples.java | 21 + .../generated/TokensUpdateSamples.java | 44 + .../generated/WebhooksCreateSamples.java | 50 + .../generated/WebhooksDeleteSamples.java | 21 + .../WebhooksGetCallbackConfigSamples.java | 24 + .../generated/WebhooksGetSamples.java | 23 + .../generated/WebhooksListEventsSamples.java | 21 + .../generated/WebhooksListSamples.java | 21 + .../generated/WebhooksPingSamples.java | 23 + .../generated/WebhooksUpdateSamples.java | 53 + sdk/containerregistry/ci.yml | 17 +- sdk/containerregistry/pom.xml | 1 + 517 files changed, 90301 insertions(+), 5 deletions(-) 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/SAMPLE.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/ArchiveVersionsClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ArchivesClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/CacheRulesClient.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/CredentialSetsClient.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/AgentPoolProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolPropertiesUpdateParameters.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/ArchiveInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveUpdateProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveVersionInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveVersionProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CacheRuleInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CacheRuleProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CacheRuleUpdateProperties.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/ConnectedRegistryProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryUpdateProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetUpdateProperties.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/ExportPipelineProperties.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/ImportPipelineProperties.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/OperationPropertiesDefinition.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/PipelineRunProperties.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/PrivateEndpointConnectionProperties.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/PrivateLinkResourceProperties.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/RegistryProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryPropertiesUpdateParameters.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/ReplicationProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationUpdateParametersProperties.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/RunProperties.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/ScopeMapProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapPropertiesUpdateParameters.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/TaskProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskPropertiesUpdateParameters.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/TaskRunPropertiesInner.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunPropertiesUpdateParameters.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/TokenProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenUpdateProperties.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/WebhookProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesCreateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesUpdateParameters.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/ArchiveImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveVersionImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveVersionsClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveVersionsImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchivesClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchivesImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CacheRuleImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CacheRulesClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CacheRulesImpl.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/CredentialSetImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CredentialSetsClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CredentialSetsImpl.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/TaskRunPropertiesImpl.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/Archive.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchivePackageSourceProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersion.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersionListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersions.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Archives.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/AuthCredential.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/AzureADAuthenticationAsArmPolicy.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicyStatus.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/CacheRule.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRuleUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRules.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRulesListResult.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/CredentialHealth.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialHealthStatus.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialName.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSet.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSetListResult.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSetUpdateParameters.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSets.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/DebianArchivePackageSourceProperties.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DebianArchiveProperties.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/MetadataSearch.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/PackageSourceType.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/SoftDeletePolicy.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/TaskRunProperties.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/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 create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsGetQueueStatusSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeactivateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/OperationsListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCheckNameAvailabilitySamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGenerateCredentialsSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetBuildSourceUploadUrlSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetByResourceGroupSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetPrivateLinkResourceSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesImportImageSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListByResourceGroupSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListCredentialsSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListPrivateLinkResourcesSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListUsagesSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesRegenerateCredentialSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesScheduleRunSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsCancelSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsGetLogSasUrlSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsGetDetailsSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksGetDetailsSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensUpdateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksCreateSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksDeleteSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetCallbackConfigSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListEventsSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksPingSamples.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksUpdateSamples.java diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 04778a9a5475b..174ade0d60fa8 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -431,6 +431,7 @@ com.azure.resourcemanager:azure-resourcemanager-hdinsight-containers;1.0.0-beta. com.azure.resourcemanager:azure-resourcemanager-apicenter;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hybridconnectivity;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-playwrighttesting;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-containerregistry-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 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..10c6c552b4a7e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-09-29) + +- Azure Resource Manager ContainerRegistry client library for Java. This package contains Microsoft Azure SDK for ContainerRegistry Management SDK. Package tag package-2023-11-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..9b73c022b1232 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/README.md @@ -0,0 +1,107 @@ +# 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-2023-11-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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the 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 `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the 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 + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[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/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fcontainerregistry%2Fazure-resourcemanager-containerregistry-generated%2FREADME.png) diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/SAMPLE.md b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/SAMPLE.md new file mode 100644 index 0000000000000..cc6e78a5f17f6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/SAMPLE.md @@ -0,0 +1,3930 @@ +# Code snippets and samples + + +## AgentPools + +- [Create](#agentpools_create) +- [Delete](#agentpools_delete) +- [Get](#agentpools_get) +- [GetQueueStatus](#agentpools_getqueuestatus) +- [List](#agentpools_list) +- [Update](#agentpools_update) + +## ArchiveVersions + +- [Create](#archiveversions_create) +- [Delete](#archiveversions_delete) +- [Get](#archiveversions_get) +- [List](#archiveversions_list) + +## Archives + +- [Create](#archives_create) +- [Delete](#archives_delete) +- [Get](#archives_get) +- [List](#archives_list) +- [Update](#archives_update) + +## CacheRules + +- [Create](#cacherules_create) +- [Delete](#cacherules_delete) +- [Get](#cacherules_get) +- [List](#cacherules_list) +- [Update](#cacherules_update) + +## ConnectedRegistries + +- [Create](#connectedregistries_create) +- [Deactivate](#connectedregistries_deactivate) +- [Delete](#connectedregistries_delete) +- [Get](#connectedregistries_get) +- [List](#connectedregistries_list) +- [Update](#connectedregistries_update) + +## CredentialSets + +- [Create](#credentialsets_create) +- [Delete](#credentialsets_delete) +- [Get](#credentialsets_get) +- [List](#credentialsets_list) +- [Update](#credentialsets_update) + +## ExportPipelines + +- [Create](#exportpipelines_create) +- [Delete](#exportpipelines_delete) +- [Get](#exportpipelines_get) +- [List](#exportpipelines_list) + +## ImportPipelines + +- [Create](#importpipelines_create) +- [Delete](#importpipelines_delete) +- [Get](#importpipelines_get) +- [List](#importpipelines_list) + +## Operations + +- [List](#operations_list) + +## PipelineRuns + +- [Create](#pipelineruns_create) +- [Delete](#pipelineruns_delete) +- [Get](#pipelineruns_get) +- [List](#pipelineruns_list) + +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) + +## Registries + +- [CheckNameAvailability](#registries_checknameavailability) +- [Create](#registries_create) +- [Delete](#registries_delete) +- [GenerateCredentials](#registries_generatecredentials) +- [GetBuildSourceUploadUrl](#registries_getbuildsourceuploadurl) +- [GetByResourceGroup](#registries_getbyresourcegroup) +- [GetPrivateLinkResource](#registries_getprivatelinkresource) +- [ImportImage](#registries_importimage) +- [List](#registries_list) +- [ListByResourceGroup](#registries_listbyresourcegroup) +- [ListCredentials](#registries_listcredentials) +- [ListPrivateLinkResources](#registries_listprivatelinkresources) +- [ListUsages](#registries_listusages) +- [RegenerateCredential](#registries_regeneratecredential) +- [ScheduleRun](#registries_schedulerun) +- [Update](#registries_update) + +## Replications + +- [Create](#replications_create) +- [Delete](#replications_delete) +- [Get](#replications_get) +- [List](#replications_list) +- [Update](#replications_update) + +## Runs + +- [Cancel](#runs_cancel) +- [Get](#runs_get) +- [GetLogSasUrl](#runs_getlogsasurl) +- [List](#runs_list) +- [Update](#runs_update) + +## ScopeMaps + +- [Create](#scopemaps_create) +- [Delete](#scopemaps_delete) +- [Get](#scopemaps_get) +- [List](#scopemaps_list) +- [Update](#scopemaps_update) + +## TaskRuns + +- [Create](#taskruns_create) +- [Delete](#taskruns_delete) +- [Get](#taskruns_get) +- [GetDetails](#taskruns_getdetails) +- [List](#taskruns_list) +- [Update](#taskruns_update) + +## Tasks + +- [Create](#tasks_create) +- [Delete](#tasks_delete) +- [Get](#tasks_get) +- [GetDetails](#tasks_getdetails) +- [List](#tasks_list) +- [Update](#tasks_update) + +## Tokens + +- [Create](#tokens_create) +- [Delete](#tokens_delete) +- [Get](#tokens_get) +- [List](#tokens_list) +- [Update](#tokens_update) + +## Webhooks + +- [Create](#webhooks_create) +- [Delete](#webhooks_delete) +- [Get](#webhooks_get) +- [GetCallbackConfig](#webhooks_getcallbackconfig) +- [List](#webhooks_list) +- [ListEvents](#webhooks_listevents) +- [Ping](#webhooks_ping) +- [Update](#webhooks_update) +### AgentPools_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AgentPools Create. */ +public final class AgentPoolsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsCreate.json + */ + /** + * Sample code: AgentPools_Create. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .agentPools() + .define("myAgentPool") + .withRegion("WESTUS") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withCount(1) + .withTier("S1") + .withOs(OS.LINUX) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### AgentPools_Delete + +```java +/** Samples for AgentPools Delete. */ +public final class AgentPoolsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsDelete.json + */ + /** + * Sample code: AgentPools_Delete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.agentPools().delete("myResourceGroup", "myRegistry", "myAgentPool", com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_Get + +```java +/** Samples for AgentPools Get. */ +public final class AgentPoolsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json + */ + /** + * Sample code: AgentPools_Get. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .agentPools() + .getWithResponse("myResourceGroup", "myRegistry", "myAgentPool", com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_GetQueueStatus + +```java +/** Samples for AgentPools GetQueueStatus. */ +public final class AgentPoolsGetQueueStatusSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGetQueueStatus.json + */ + /** + * Sample code: AgentPools_GetQueueStatus. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsGetQueueStatus( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .agentPools() + .getQueueStatusWithResponse( + "myResourceGroup", "myRegistry", "myAgentPool", com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_List + +```java +/** Samples for AgentPools List. */ +public final class AgentPoolsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsList.json + */ + /** + * Sample code: AgentPools_List. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.agentPools().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### AgentPools_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.AgentPool; + +/** Samples for AgentPools Update. */ +public final class AgentPoolsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsUpdate.json + */ + /** + * Sample code: AgentPools_Update. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + AgentPool resource = + manager + .agentPools() + .getWithResponse("myResourceGroup", "myRegistry", "myAgentPool", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withCount(1).apply(); + } +} +``` + +### ArchiveVersions_Create + +```java +/** Samples for ArchiveVersions Create. */ +public final class ArchiveVersionsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionCreate.json + */ + /** + * Sample code: ArchiveVersionCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveVersionCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archiveVersions() + .create( + "myResourceGroup", + "myRegistry", + "rpm", + "myArchiveName", + "myArchiveVersionName", + com.azure.core.util.Context.NONE); + } +} +``` + +### ArchiveVersions_Delete + +```java +/** Samples for ArchiveVersions Delete. */ +public final class ArchiveVersionsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionDelete.json + */ + /** + * Sample code: ArchiveVersionDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveVersionDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archiveVersions() + .delete( + "myResourceGroup", + "myRegistry", + "myPackageType", + "myArchiveName", + "myArchiveVersionName", + com.azure.core.util.Context.NONE); + } +} +``` + +### ArchiveVersions_Get + +```java +/** Samples for ArchiveVersions Get. */ +public final class ArchiveVersionsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionGet.json + */ + /** + * Sample code: ArchiveVersionGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveVersionGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archiveVersions() + .getWithResponse( + "myResourceGroup", + "myRegistry", + "rpm", + "myArchiveName", + "myArchiveVersionName", + com.azure.core.util.Context.NONE); + } +} +``` + +### ArchiveVersions_List + +```java +/** Samples for ArchiveVersions List. */ +public final class ArchiveVersionsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionList.json + */ + /** + * Sample code: ArchiveVersionList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveVersionList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archiveVersions() + .list("myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", com.azure.core.util.Context.NONE); + } +} +``` + +### Archives_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.ArchivePackageSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PackageSourceType; + +/** Samples for Archives Create. */ +public final class ArchivesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveCreate.json + */ + /** + * Sample code: ArchiveCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archives() + .define("myArchiveName") + .withExistingPackage("myResourceGroup", "myRegistry", "rpm") + .withPackageSource( + new ArchivePackageSourceProperties().withType(PackageSourceType.REMOTE).withUrl("string")) + .withPublishedVersion("string") + .withRepositoryEndpointPrefix("string") + .create(); + } +} +``` + +### Archives_Delete + +```java +/** Samples for Archives Delete. */ +public final class ArchivesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveDelete.json + */ + /** + * Sample code: ArchiveDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archives() + .delete( + "myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", com.azure.core.util.Context.NONE); + } +} +``` + +### Archives_Get + +```java +/** Samples for Archives Get. */ +public final class ArchivesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveGet.json + */ + /** + * Sample code: ArchiveGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archives() + .getWithResponse( + "myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", com.azure.core.util.Context.NONE); + } +} +``` + +### Archives_List + +```java +/** Samples for Archives List. */ +public final class ArchivesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveList.json + */ + /** + * Sample code: ArchiveList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.archives().list("myResourceGroup", "myRegistry", "myPackageType", com.azure.core.util.Context.NONE); + } +} +``` + +### Archives_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.Archive; + +/** Samples for Archives Update. */ +public final class ArchivesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveUpdate.json + */ + /** + * Sample code: ArchiveUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Archive resource = + manager + .archives() + .getWithResponse( + "myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withPublishedVersion("string").apply(); + } +} +``` + +### CacheRules_Create + +```java +/** Samples for CacheRules Create. */ +public final class CacheRulesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleCreate.json + */ + /** + * Sample code: CacheRuleCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void cacheRuleCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .cacheRules() + .define("myCacheRule") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withCredentialSetResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet") + .withSourceRepository("docker.io/library/hello-world") + .withTargetRepository("cached-docker-hub/hello-world") + .create(); + } +} +``` + +### CacheRules_Delete + +```java +/** Samples for CacheRules Delete. */ +public final class CacheRulesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleDelete.json + */ + /** + * Sample code: CacheRuleDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void cacheRuleDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.cacheRules().delete("myResourceGroup", "myRegistry", "myCacheRule", com.azure.core.util.Context.NONE); + } +} +``` + +### CacheRules_Get + +```java +/** Samples for CacheRules Get. */ +public final class CacheRulesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleGet.json + */ + /** + * Sample code: CacheRuleGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void cacheRuleGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .cacheRules() + .getWithResponse("myResourceGroup", "myRegistry", "myCacheRule", com.azure.core.util.Context.NONE); + } +} +``` + +### CacheRules_List + +```java +/** Samples for CacheRules List. */ +public final class CacheRulesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleList.json + */ + /** + * Sample code: CacheRuleList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void cacheRuleList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.cacheRules().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### CacheRules_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.CacheRule; + +/** Samples for CacheRules Update. */ +public final class CacheRulesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleUpdate.json + */ + /** + * Sample code: CacheRuleUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void cacheRuleUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + CacheRule resource = + manager + .cacheRules() + .getWithResponse("myResourceGroup", "myRegistry", "myCacheRule", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withCredentialSetResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2") + .apply(); + } +} +``` + +### ConnectedRegistries_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryMode; +import com.azure.resourcemanager.containerregistry.generated.models.ParentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncProperties; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for ConnectedRegistries Create. */ +public final class ConnectedRegistriesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryCreate.json + */ + /** + * Sample code: ConnectedRegistryCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .define("myConnectedRegistry") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withMode(ConnectedRegistryMode.READ_WRITE) + .withParent( + new ParentProperties() + .withSyncProperties( + new SyncProperties() + .withTokenId("fakeTokenPlaceholder") + .withSchedule("0 9 * * *") + .withSyncWindow(Duration.parse("PT3H")) + .withMessageTtl(Duration.parse("P2D")))) + .withClientTokenIds( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")) + .withNotificationsList(Arrays.asList("hello-world:*:*", "sample/repo/*:1.0:*")) + .create(); + } +} +``` + +### ConnectedRegistries_Deactivate + +```java +/** Samples for ConnectedRegistries Deactivate. */ +public final class ConnectedRegistriesDeactivateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryDeactivate.json + */ + /** + * Sample code: ConnectedRegistryDeactivate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryDeactivate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .deactivate("myResourceGroup", "myRegistry", "myConnectedRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedRegistries_Delete + +```java +/** Samples for ConnectedRegistries Delete. */ +public final class ConnectedRegistriesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryDelete.json + */ + /** + * Sample code: ConnectedRegistryDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .delete("myResourceGroup", "myRegistry", "myConnectedRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedRegistries_Get + +```java +/** Samples for ConnectedRegistries Get. */ +public final class ConnectedRegistriesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryGet.json + */ + /** + * Sample code: ConnectedRegistryGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .getWithResponse("myResourceGroup", "myRegistry", "myConnectedRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedRegistries_List + +```java +/** Samples for ConnectedRegistries List. */ +public final class ConnectedRegistriesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryList.json + */ + /** + * Sample code: ConnectedRegistryList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.connectedRegistries().list("myResourceGroup", "myRegistry", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedRegistries_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.AuditLogStatus; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistry; +import com.azure.resourcemanager.containerregistry.generated.models.LogLevel; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncUpdateProperties; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for ConnectedRegistries Update. */ +public final class ConnectedRegistriesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryUpdate.json + */ + /** + * Sample code: ConnectedRegistryUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + ConnectedRegistry resource = + manager + .connectedRegistries() + .getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withSyncProperties( + new SyncUpdateProperties() + .withSchedule("0 0 */10 * *") + .withSyncWindow(Duration.parse("P2D")) + .withMessageTtl(Duration.parse("P30D"))) + .withLogging( + new LoggingProperties().withLogLevel(LogLevel.DEBUG).withAuditLogStatus(AuditLogStatus.ENABLED)) + .withClientTokenIds( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token")) + .withNotificationsList(Arrays.asList("hello-world:*:*", "sample/repo/*:1.0:*")) + .apply(); + } +} +``` + +### CredentialSets_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.AuthCredential; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialName; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ResourceIdentityType; +import java.util.Arrays; + +/** Samples for CredentialSets Create. */ +public final class CredentialSetsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetCreate.json + */ + /** + * Sample code: CredentialSetCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void credentialSetCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .credentialSets() + .define("myCredentialSet") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withLoginServer("docker.io") + .withAuthCredentials( + Arrays + .asList( + new AuthCredential() + .withName(CredentialName.CREDENTIAL1) + .withUsernameSecretIdentifier("fakeTokenPlaceholder") + .withPasswordSecretIdentifier("fakeTokenPlaceholder"))) + .create(); + } +} +``` + +### CredentialSets_Delete + +```java +/** Samples for CredentialSets Delete. */ +public final class CredentialSetsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetDelete.json + */ + /** + * Sample code: CredentialSetDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void credentialSetDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .credentialSets() + .delete("myResourceGroup", "myRegistry", "myCredentialSet", com.azure.core.util.Context.NONE); + } +} +``` + +### CredentialSets_Get + +```java +/** Samples for CredentialSets Get. */ +public final class CredentialSetsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetGet.json + */ + /** + * Sample code: CredentialSetGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void credentialSetGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .credentialSets() + .getWithResponse("myResourceGroup", "myRegistry", "myCredentialSet", com.azure.core.util.Context.NONE); + } +} +``` + +### CredentialSets_List + +```java +/** Samples for CredentialSets List. */ +public final class CredentialSetsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetList.json + */ + /** + * Sample code: CredentialSetList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void credentialSetList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.credentialSets().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### CredentialSets_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.AuthCredential; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialName; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialSet; +import java.util.Arrays; + +/** Samples for CredentialSets Update. */ +public final class CredentialSetsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetUpdate.json + */ + /** + * Sample code: CredentialSetUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void credentialSetUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + CredentialSet resource = + manager + .credentialSets() + .getWithResponse("myResourceGroup", "myRegistry", "myCredentialSet", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withAuthCredentials( + Arrays + .asList( + new AuthCredential() + .withName(CredentialName.CREDENTIAL1) + .withUsernameSecretIdentifier("fakeTokenPlaceholder") + .withPasswordSecretIdentifier("fakeTokenPlaceholder"))) + .apply(); + } +} +``` + +### ExportPipelines_Create + +```java +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.ResourceIdentityType; +import java.util.Arrays; + +/** Samples for ExportPipelines Create. */ +public final class ExportPipelinesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineCreate.json + */ + /** + * Sample code: ExportPipelineCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .exportPipelines() + .define("myExportPipeline") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRegion("westus") + .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withTarget( + new ExportPipelineTargetProperties() + .withType("AzureStorageBlobContainer") + .withUri("https://accountname.blob.core.windows.net/containername") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withOptions(Arrays.asList(PipelineOptions.OVERWRITE_BLOBS)) + .create(); + } +} +``` + +### ExportPipelines_Delete + +```java +/** Samples for ExportPipelines Delete. */ +public final class ExportPipelinesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineDelete.json + */ + /** + * Sample code: ExportPipelineDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .exportPipelines() + .delete("myResourceGroup", "myRegistry", "myExportPipeline", com.azure.core.util.Context.NONE); + } +} +``` + +### ExportPipelines_Get + +```java +/** Samples for ExportPipelines Get. */ +public final class ExportPipelinesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineGet.json + */ + /** + * Sample code: ExportPipelineGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .exportPipelines() + .getWithResponse("myResourceGroup", "myRegistry", "myExportPipeline", com.azure.core.util.Context.NONE); + } +} +``` + +### ExportPipelines_List + +```java +/** Samples for ExportPipelines List. */ +public final class ExportPipelinesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineList.json + */ + /** + * Sample code: ExportPipelineList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.exportPipelines().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### ImportPipelines_Create + +```java +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.PipelineSourceType; +import com.azure.resourcemanager.containerregistry.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerregistry.generated.models.UserIdentityProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ImportPipelines Create. */ +public final class ImportPipelinesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineCreate.json + */ + /** + * Sample code: ImportPipelineCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .importPipelines() + .define("myImportPipeline") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRegion("westus") + .withIdentity( + new IdentityProperties() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentityProperties()))) + .withSource( + new ImportPipelineSourceProperties() + .withType(PipelineSourceType.AZURE_STORAGE_BLOB_CONTAINER) + .withUri("https://accountname.blob.core.windows.net/containername") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withOptions( + Arrays + .asList( + PipelineOptions.OVERWRITE_TAGS, + PipelineOptions.DELETE_SOURCE_BLOB_ON_SUCCESS, + PipelineOptions.CONTINUE_ON_ERRORS)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ImportPipelines_Delete + +```java +/** Samples for ImportPipelines Delete. */ +public final class ImportPipelinesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineDelete.json + */ + /** + * Sample code: ImportPipelineDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .importPipelines() + .delete("myResourceGroup", "myRegistry", "myImportPipeline", com.azure.core.util.Context.NONE); + } +} +``` + +### ImportPipelines_Get + +```java +/** Samples for ImportPipelines Get. */ +public final class ImportPipelinesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineGet.json + */ + /** + * Sample code: ImportPipelineGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .importPipelines() + .getWithResponse("myResourceGroup", "myRegistry", "myImportPipeline", com.azure.core.util.Context.NONE); + } +} +``` + +### ImportPipelines_List + +```java +/** Samples for ImportPipelines List. */ +public final class ImportPipelinesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineList.json + */ + /** + * Sample code: ImportPipelineList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.importPipelines().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/OperationList.json + */ + /** + * Sample code: OperationList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void operationList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PipelineRuns_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunSourceType; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunTargetType; +import java.util.Arrays; + +/** Samples for PipelineRuns Create. */ +public final class PipelineRunsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunCreate_Import.json + */ + /** + * Sample code: PipelineRunCreate_Import. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunCreateImport( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .define("myPipelineRun") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRequest( + new PipelineRunRequest() + .withPipelineResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline") + .withSource( + new PipelineRunSourceProperties() + .withType(PipelineRunSourceType.AZURE_STORAGE_BLOB) + .withName("myblob.tar.gz")) + .withCatalogDigest("sha256@")) + .withForceUpdateTag("2020-03-04T17:23:21.9261521+00:00") + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunCreate_Export.json + */ + /** + * Sample code: PipelineRunCreate_Export. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunCreateExport( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .define("myPipelineRun") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRequest( + new PipelineRunRequest() + .withPipelineResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline") + .withArtifacts( + Arrays + .asList( + "sourceRepository/hello-world", + "sourceRepository2@sha256:00000000000000000000000000000000000")) + .withTarget( + new PipelineRunTargetProperties() + .withType(PipelineRunTargetType.AZURE_STORAGE_BLOB) + .withName("myblob.tar.gz"))) + .create(); + } +} +``` + +### PipelineRuns_Delete + +```java +/** Samples for PipelineRuns Delete. */ +public final class PipelineRunsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunDelete.json + */ + /** + * Sample code: PipelineRunDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .delete("myResourceGroup", "myRegistry", "myPipelineRun", com.azure.core.util.Context.NONE); + } +} +``` + +### PipelineRuns_Get + +```java +/** Samples for PipelineRuns Get. */ +public final class PipelineRunsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunGet.json + */ + /** + * Sample code: PipelineRunGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .getWithResponse("myResourceGroup", "myRegistry", "myPipelineRun", com.azure.core.util.Context.NONE); + } +} +``` + +### PipelineRuns_List + +```java +/** Samples for PipelineRuns List. */ +public final class PipelineRunsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunList.json + */ + /** + * Sample code: PipelineRunList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.pipelineRuns().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerregistry.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json + */ + /** + * Sample code: PrivateEndpointConnectionCreateOrUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionCreateOrUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .privateEndpointConnections() + .define("myConnection") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(ConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: PrivateEndpointConnectionDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .privateEndpointConnections() + .delete("myResourceGroup", "myRegistry", "myConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: PrivateEndpointConnectionGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "myRegistry", "myConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: PrivateEndpointConnectionList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.privateEndpointConnections().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_CheckNameAvailability + +```java +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameCheckRequest; + +/** Samples for Registries CheckNameAvailability. */ +public final class RegistriesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCheckNameAvailable.json + */ + /** + * Sample code: RegistryCheckNameAvailable. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCheckNameAvailable( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .checkNameAvailabilityWithResponse( + new RegistryNameCheckRequest().withName("myRegistry"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCheckNameNotAvailable.json + */ + /** + * Sample code: RegistryCheckNameNotAvailable. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCheckNameNotAvailable( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .checkNameAvailabilityWithResponse( + new RegistryNameCheckRequest().withName("myRegistry"), com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.SkuName; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries Create. */ +public final class RegistriesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCreateZoneRedundant.json + */ + /** + * Sample code: RegistryCreateZoneRedundant. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCreateZoneRedundant( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .define("myRegistry") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName(SkuName.STANDARD)) + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withZoneRedundancy(ZoneRedundancy.ENABLED) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCreate.json + */ + /** + * Sample code: RegistryCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .define("myRegistry") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName(SkuName.STANDARD)) + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withAdminUserEnabled(true) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Registries_Delete + +```java +/** Samples for Registries Delete. */ +public final class RegistriesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryDelete.json + */ + /** + * Sample code: RegistryDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().delete("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_GenerateCredentials + +```java +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import java.time.OffsetDateTime; + +/** Samples for Registries GenerateCredentials. */ +public final class RegistriesGenerateCredentialsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGenerateCredentials.json + */ + /** + * Sample code: RegistryGenerateCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGenerateCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .generateCredentials( + "myResourceGroup", + "myRegistry", + new GenerateCredentialsParameters() + .withTokenId("fakeTokenPlaceholder") + .withExpiry(OffsetDateTime.parse("2020-12-31T15:59:59.0707808Z")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_GetBuildSourceUploadUrl + +```java +/** Samples for Registries GetBuildSourceUploadUrl. */ +public final class RegistriesGetBuildSourceUploadUrlSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json + */ + /** + * Sample code: Registries_GetBuildSourceUploadUrl. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesGetBuildSourceUploadUrl( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .getBuildSourceUploadUrlWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_GetByResourceGroup + +```java +/** Samples for Registries GetByResourceGroup. */ +public final class RegistriesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGet.json + */ + /** + * Sample code: RegistryGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .getByResourceGroupWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_GetPrivateLinkResource + +```java +/** Samples for Registries GetPrivateLinkResource. */ +public final class RegistriesGetPrivateLinkResourceSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGetPrivateLinkResource.json + */ + /** + * Sample code: RegistryGetPrivateLinkResource. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGetPrivateLinkResource( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .getPrivateLinkResourceWithResponse( + "myResourceGroup", "myRegistry", "registry", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_ImportImage + +```java +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ImportMode; +import com.azure.resourcemanager.containerregistry.generated.models.ImportSource; +import java.util.Arrays; + +/** Samples for Registries ImportImage. */ +public final class RegistriesImportImageSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageFromPublicRegistry.json + */ + /** + * Sample code: ImportImageFromPublicRegistry. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageFromPublicRegistry( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withRegistryUri("registry.hub.docker.com") + .withSourceImage("library/hello-world")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageByTag.json + */ + /** + * Sample code: ImportImageByTag. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageByTag( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withResourceId( + "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry") + .withSourceImage("sourceRepository:sourceTag")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageByManifestDigest.json + */ + /** + * Sample code: ImportImageByManifestDigest. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageByManifestDigest( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withResourceId( + "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry") + .withSourceImage( + "sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_List + +```java +/** Samples for Registries List. */ +public final class RegistriesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryList.json + */ + /** + * Sample code: RegistryList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_ListByResourceGroup + +```java +/** Samples for Registries ListByResourceGroup. */ +public final class RegistriesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListByResourceGroup.json + */ + /** + * Sample code: RegistryListByResourceGroup. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListByResourceGroup( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_ListCredentials + +```java +/** Samples for Registries ListCredentials. */ +public final class RegistriesListCredentialsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListCredentials.json + */ + /** + * Sample code: RegistryListCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .listCredentialsWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_ListPrivateLinkResources + +```java +/** Samples for Registries ListPrivateLinkResources. */ +public final class RegistriesListPrivateLinkResourcesSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListPrivateLinkResources.json + */ + /** + * Sample code: RegistryListPrivateLinkResources. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListPrivateLinkResources( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .listPrivateLinkResources("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_ListUsages + +```java +/** Samples for Registries ListUsages. */ +public final class RegistriesListUsagesSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListUsages.json + */ + /** + * Sample code: RegistryListUsages. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListUsages( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listUsagesWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_RegenerateCredential + +```java +import com.azure.resourcemanager.containerregistry.generated.models.PasswordName; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; + +/** Samples for Registries RegenerateCredential. */ +public final class RegistriesRegenerateCredentialSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryRegenerateCredential.json + */ + /** + * Sample code: RegistryRegenerateCredential. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryRegenerateCredential( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .regenerateCredentialWithResponse( + "myResourceGroup", + "myRegistry", + new RegenerateCredentialParameters().withName(PasswordName.PASSWORD), + com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_ScheduleRun + +```java +import com.azure.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.Architecture; +import com.azure.resourcemanager.containerregistry.generated.models.Argument; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.CustomRegistryCredentials; +import com.azure.resourcemanager.containerregistry.generated.models.DockerBuildRequest; +import com.azure.resourcemanager.containerregistry.generated.models.EncodedTaskRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.FileTaskRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.OverrideTaskStepProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SecretObject; +import com.azure.resourcemanager.containerregistry.generated.models.SecretObjectType; +import com.azure.resourcemanager.containerregistry.generated.models.SetValue; +import com.azure.resourcemanager.containerregistry.generated.models.SourceRegistryCredentials; +import com.azure.resourcemanager.containerregistry.generated.models.SourceRegistryLoginMode; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRunRequest; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries ScheduleRun. */ +public final class RegistriesScheduleRunSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json + */ + /** + * Sample code: Registries_ScheduleRun_FileTaskRun. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunFileTaskRun( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new FileTaskRunRequest() + .withTaskFilePath("acb.yaml") + .withValuesFilePath("prod-values.yaml") + .withValues( + Arrays + .asList( + new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new SetValue() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withSourceLocation( + "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun.json + */ + /** + * Sample code: Registries_ScheduleRun. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRun( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new DockerBuildRequest() + .withIsArchiveEnabled(true) + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(true) + .withDockerFilePath("DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withSourceLocation( + "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json + */ + /** + * Sample code: Registries_ScheduleRun_EncodedTaskRun. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunEncodedTaskRun( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new EncodedTaskRunRequest() + .withEncodedTaskContent("fakeTokenPlaceholder") + .withEncodedValuesContent("fakeTokenPlaceholder") + .withValues( + Arrays + .asList( + new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new SetValue() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX)) + .withAgentConfiguration(new AgentProperties().withCpu(2)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json + */ + /** + * Sample code: Registries_ScheduleRun_WithCustomCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunWithCustomCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new DockerBuildRequest() + .withIsArchiveEnabled(true) + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(true) + .withDockerFilePath("DockerFile") + .withTarget("stage1") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withSourceLocation( + "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D") + .withCredentials( + new Credentials() + .withSourceRegistry( + new SourceRegistryCredentials().withLoginMode(SourceRegistryLoginMode.DEFAULT)) + .withCustomRegistries( + mapOf( + "myregistry.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject().withValue("reg1").withType(SecretObjectType.OPAQUE)) + .withPassword( + new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE)), + "myregistry2.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject().withValue("reg2").withType(SecretObjectType.OPAQUE)) + .withPassword( + new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json + */ + /** + * Sample code: Registries_ScheduleRun_WithLogTemplate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunWithLogTemplate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new DockerBuildRequest() + .withIsArchiveEnabled(true) + .withLogTemplate("acr/tasks:{{.Run.OS}}") + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(true) + .withDockerFilePath("DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withSourceLocation( + "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_Task.json + */ + /** + * Sample code: Registries_ScheduleRun_Task. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunTask( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new TaskRunRequest() + .withTaskId("myTask") + .withOverrideTaskStepProperties( + new OverrideTaskStepProperties() + .withFile("overriddenDockerfile") + .withArguments( + Arrays + .asList( + new Argument() + .withName("mytestargument") + .withValue("mytestvalue") + .withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withTarget("build") + .withValues( + Arrays + .asList( + new SetValue() + .withName("mytestname") + .withValue("mytestvalue") + .withIsSecret(false), + new SetValue() + .withName("mysecrettestname") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withUpdateTriggerToken("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json + */ + /** + * Sample code: Registries_ScheduleRun_Task_WithCustomCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunTaskWithCustomCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new FileTaskRunRequest() + .withTaskFilePath("acb.yaml") + .withValues( + Arrays + .asList( + new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new SetValue() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX)) + .withCredentials( + new Credentials() + .withSourceRegistry( + new SourceRegistryCredentials().withLoginMode(SourceRegistryLoginMode.DEFAULT)) + .withCustomRegistries( + mapOf( + "myregistry.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject().withValue("reg1").withType(SecretObjectType.OPAQUE)) + .withPassword( + new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Registries_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.Registry; +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.SkuName; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries Update. */ +public final class RegistriesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryUpdate.json + */ + /** + * Sample code: RegistryUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Registry resource = + manager + .registries() + .getByResourceGroupWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withSku(new Sku().withName(SkuName.STANDARD)) + .withAdminUserEnabled(true) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Replications_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Replications Create. */ +public final class ReplicationsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationCreate.json + */ + /** + * Sample code: ReplicationCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .define("myReplication") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationCreateZoneRedundant.json + */ + /** + * Sample code: ReplicationCreateZoneRedundant. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationCreateZoneRedundant( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .define("myReplication") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withRegionEndpointEnabled(true) + .withZoneRedundancy(ZoneRedundancy.ENABLED) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Replications_Delete + +```java +/** Samples for Replications Delete. */ +public final class ReplicationsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationDelete.json + */ + /** + * Sample code: ReplicationDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .delete("myResourceGroup", "myRegistry", "myReplication", com.azure.core.util.Context.NONE); + } +} +``` + +### Replications_Get + +```java +/** Samples for Replications Get. */ +public final class ReplicationsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationGet.json + */ + /** + * Sample code: ReplicationGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .getWithResponse("myResourceGroup", "myRegistry", "myReplication", com.azure.core.util.Context.NONE); + } +} +``` + +### Replications_List + +```java +/** Samples for Replications List. */ +public final class ReplicationsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationList.json + */ + /** + * Sample code: ReplicationList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.replications().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Replications_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.Replication; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Replications Update. */ +public final class ReplicationsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationUpdate.json + */ + /** + * Sample code: ReplicationUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Replication resource = + manager + .replications() + .getWithResponse("myResourceGroup", "myRegistry", "myReplication", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Runs_Cancel + +```java +/** Samples for Runs Cancel. */ +public final class RunsCancelSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsCancel.json + */ + /** + * Sample code: Runs_Cancel. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void runsCancel( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .runs() + .cancel( + "myResourceGroup", + "myRegistry", + "0accec26-d6de-4757-8e74-d080f38eaaab", + com.azure.core.util.Context.NONE); + } +} +``` + +### Runs_Get + +```java +/** Samples for Runs Get. */ +public final class RunsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json + */ + /** + * Sample code: Runs_Get. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void runsGet(com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .runs() + .getWithResponse( + "myResourceGroup", + "myRegistry", + "0accec26-d6de-4757-8e74-d080f38eaaab", + com.azure.core.util.Context.NONE); + } +} +``` + +### Runs_GetLogSasUrl + +```java +/** Samples for Runs GetLogSasUrl. */ +public final class RunsGetLogSasUrlSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGetLogSasUrl.json + */ + /** + * Sample code: Runs_GetLogSasUrl. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void runsGetLogSasUrl( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .runs() + .getLogSasUrlWithResponse( + "myResourceGroup", + "myRegistry", + "0accec26-d6de-4757-8e74-d080f38eaaab", + com.azure.core.util.Context.NONE); + } +} +``` + +### Runs_List + +```java +/** Samples for Runs List. */ +public final class RunsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsList.json + */ + /** + * Sample code: Runs_List. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void runsList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.runs().list("myResourceGroup", "myRegistry", "", 10, com.azure.core.util.Context.NONE); + } +} +``` + +### Runs_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.RunUpdateParameters; + +/** Samples for Runs Update. */ +public final class RunsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsUpdate.json + */ + /** + * Sample code: Runs_Update. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void runsUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .runs() + .update( + "myResourceGroup", + "myRegistry", + "0accec26-d6de-4757-8e74-d080f38eaaab", + new RunUpdateParameters().withIsArchiveEnabled(true), + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeMaps_Create + +```java +import java.util.Arrays; + +/** Samples for ScopeMaps Create. */ +public final class ScopeMapsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapCreate.json + */ + /** + * Sample code: ScopeMapCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .scopeMaps() + .define("myScopeMap") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withDescription("Developer Scopes") + .withActions(Arrays.asList("repositories/myrepository/contentWrite", "repositories/myrepository/delete")) + .create(); + } +} +``` + +### ScopeMaps_Delete + +```java +/** Samples for ScopeMaps Delete. */ +public final class ScopeMapsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapDelete.json + */ + /** + * Sample code: ScopeMapDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.scopeMaps().delete("myResourceGroup", "myRegistry", "myScopeMap", com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeMaps_Get + +```java +/** Samples for ScopeMaps Get. */ +public final class ScopeMapsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapGet.json + */ + /** + * Sample code: ScopeMapGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .scopeMaps() + .getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeMaps_List + +```java +/** Samples for ScopeMaps List. */ +public final class ScopeMapsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapList.json + */ + /** + * Sample code: ScopeMapList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.scopeMaps().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeMaps_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMap; +import java.util.Arrays; + +/** Samples for ScopeMaps Update. */ +public final class ScopeMapsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapUpdate.json + */ + /** + * Sample code: ScopeMapUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + ScopeMap resource = + manager + .scopeMaps() + .getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withDescription("Developer Scopes") + .withActions( + Arrays.asList("repositories/myrepository/contentWrite", "repositories/myrepository/contentRead")) + .apply(); + } +} +``` + +### TaskRuns_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.Architecture; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.EncodedTaskRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import java.util.Arrays; + +/** Samples for TaskRuns Create. */ +public final class TaskRunsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsCreate.json + */ + /** + * Sample code: TaskRuns_Create. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .taskRuns() + .define("myRun") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRunRequest( + new EncodedTaskRunRequest() + .withEncodedTaskContent("fakeTokenPlaceholder") + .withEncodedValuesContent("fakeTokenPlaceholder") + .withValues(Arrays.asList()) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withCredentials(new Credentials())) + .withForceUpdateTag("test") + .create(); + } +} +``` + +### TaskRuns_Delete + +```java +/** Samples for TaskRuns Delete. */ +public final class TaskRunsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsDelete.json + */ + /** + * Sample code: TaskRuns_Delete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.taskRuns().delete("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE); + } +} +``` + +### TaskRuns_Get + +```java +/** Samples for TaskRuns Get. */ +public final class TaskRunsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json + */ + /** + * Sample code: TaskRuns_Get. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.taskRuns().getWithResponse("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE); + } +} +``` + +### TaskRuns_GetDetails + +```java +/** Samples for TaskRuns GetDetails. */ +public final class TaskRunsGetDetailsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGetDetails.json + */ + /** + * Sample code: TaskRuns_GetDetails. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsGetDetails( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .taskRuns() + .getDetailsWithResponse("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE); + } +} +``` + +### TaskRuns_List + +```java +/** Samples for TaskRuns List. */ +public final class TaskRunsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsList.json + */ + /** + * Sample code: TaskRuns_List. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.taskRuns().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### TaskRuns_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.Architecture; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.EncodedTaskRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRun; +import java.util.Arrays; + +/** Samples for TaskRuns Update. */ +public final class TaskRunsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsUpdate.json + */ + /** + * Sample code: TaskRuns_Update. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + TaskRun resource = + manager + .taskRuns() + .getWithResponse("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withRunRequest( + new EncodedTaskRunRequest() + .withIsArchiveEnabled(true) + .withEncodedTaskContent("fakeTokenPlaceholder") + .withEncodedValuesContent("fakeTokenPlaceholder") + .withValues(Arrays.asList()) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withCredentials(new Credentials())) + .withForceUpdateTag("test") + .apply(); + } +} +``` + +### Tasks_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.Architecture; +import com.azure.resourcemanager.containerregistry.generated.models.Argument; +import com.azure.resourcemanager.containerregistry.generated.models.AuthInfo; +import com.azure.resourcemanager.containerregistry.generated.models.BaseImageTrigger; +import com.azure.resourcemanager.containerregistry.generated.models.BaseImageTriggerType; +import com.azure.resourcemanager.containerregistry.generated.models.DockerTaskStep; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerregistry.generated.models.SourceControlType; +import com.azure.resourcemanager.containerregistry.generated.models.SourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SourceTrigger; +import com.azure.resourcemanager.containerregistry.generated.models.SourceTriggerEvent; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStatus; +import com.azure.resourcemanager.containerregistry.generated.models.TimerTrigger; +import com.azure.resourcemanager.containerregistry.generated.models.TokenType; +import com.azure.resourcemanager.containerregistry.generated.models.TriggerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.UpdateTriggerPayloadType; +import com.azure.resourcemanager.containerregistry.generated.models.UserIdentityProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Tasks Create. */ +public final class TasksCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json + */ + /** + * Sample code: Tasks_Create_WithUserIdentities_WithSystemIdentity. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksCreateWithUserIdentitiesWithSystemIdentity( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .define("mytTask") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withStatus(TaskStatus.ENABLED) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withStep( + new DockerTaskStep() + .withContextPath("src") + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(false) + .withDockerFilePath("src/DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true)))) + .withTrigger( + new TriggerProperties() + .withTimerTriggers( + Arrays.asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) + .withSourceTriggers( + Arrays + .asList( + new SourceTrigger() + .withSourceRepository( + new SourceProperties() + .withSourceControlType(SourceControlType.GITHUB) + .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") + .withBranch("master") + .withSourceControlAuthProperties( + new AuthInfo() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger"))) + .withBaseImageTrigger( + new BaseImageTrigger() + .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) + .withName("myBaseImageTrigger"))) + .withIsSystemTask(false) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate.json + */ + /** + * Sample code: Tasks_Create. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .define("mytTask") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withStatus(TaskStatus.ENABLED) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withStep( + new DockerTaskStep() + .withContextPath("src") + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(false) + .withDockerFilePath("src/DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true)))) + .withTrigger( + new TriggerProperties() + .withTimerTriggers( + Arrays.asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) + .withSourceTriggers( + Arrays + .asList( + new SourceTrigger() + .withSourceRepository( + new SourceProperties() + .withSourceControlType(SourceControlType.GITHUB) + .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") + .withBranch("master") + .withSourceControlAuthProperties( + new AuthInfo() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger"))) + .withBaseImageTrigger( + new BaseImageTrigger() + .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) + .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo") + .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.TOKEN) + .withName("myBaseImageTrigger"))) + .withLogTemplate("acr/tasks:{{.Run.OS}}") + .withIsSystemTask(false) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json + */ + /** + * Sample code: Tasks_Create_WithSystemAndUserIdentities. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksCreateWithSystemAndUserIdentities( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .define("mytTask") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withIdentity( + new IdentityProperties() + .withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentityProperties()))) + .withStatus(TaskStatus.ENABLED) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withStep( + new DockerTaskStep() + .withContextPath("src") + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(false) + .withDockerFilePath("src/DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true)))) + .withTrigger( + new TriggerProperties() + .withTimerTriggers( + Arrays.asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) + .withSourceTriggers( + Arrays + .asList( + new SourceTrigger() + .withSourceRepository( + new SourceProperties() + .withSourceControlType(SourceControlType.GITHUB) + .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") + .withBranch("master") + .withSourceControlAuthProperties( + new AuthInfo() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger"))) + .withBaseImageTrigger( + new BaseImageTrigger() + .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) + .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo") + .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.DEFAULT) + .withName("myBaseImageTrigger"))) + .withIsSystemTask(false) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json + */ + /** + * Sample code: Tasks_Create_WithUserIdentities. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksCreateWithUserIdentities( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .define("mytTask") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withIdentity( + new IdentityProperties() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new UserIdentityProperties(), + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentityProperties()))) + .withStatus(TaskStatus.ENABLED) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withStep( + new DockerTaskStep() + .withContextPath("src") + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(false) + .withDockerFilePath("src/DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true)))) + .withTrigger( + new TriggerProperties() + .withTimerTriggers( + Arrays.asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) + .withSourceTriggers( + Arrays + .asList( + new SourceTrigger() + .withSourceRepository( + new SourceProperties() + .withSourceControlType(SourceControlType.GITHUB) + .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") + .withBranch("master") + .withSourceControlAuthProperties( + new AuthInfo() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger"))) + .withBaseImageTrigger( + new BaseImageTrigger() + .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) + .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo") + .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.DEFAULT) + .withName("myBaseImageTrigger"))) + .withIsSystemTask(false) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate_QuickTask.json + */ + /** + * Sample code: Tasks_Create_QuickTask. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksCreateQuickTask( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .define("quicktask") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withLogTemplate("acr/tasks:{{.Run.OS}}") + .withIsSystemTask(true) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Tasks_Delete + +```java +/** Samples for Tasks Delete. */ +public final class TasksDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksDelete.json + */ + /** + * Sample code: Tasks_Delete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tasks().delete("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE); + } +} +``` + +### Tasks_Get + +```java +/** Samples for Tasks Get. */ +public final class TasksGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json + */ + /** + * Sample code: Tasks_Get. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tasks().getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE); + } +} +``` + +### Tasks_GetDetails + +```java +/** Samples for Tasks GetDetails. */ +public final class TasksGetDetailsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGetDetails.json + */ + /** + * Sample code: Tasks_GetDetails. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksGetDetails( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .getDetailsWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE); + } +} +``` + +### Tasks_List + +```java +/** Samples for Tasks List. */ +public final class TasksListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksList.json + */ + /** + * Sample code: Tasks_List. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tasks().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Tasks_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.AuthInfoUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.CustomRegistryCredentials; +import com.azure.resourcemanager.containerregistry.generated.models.DockerBuildStepUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.SecretObject; +import com.azure.resourcemanager.containerregistry.generated.models.SecretObjectType; +import com.azure.resourcemanager.containerregistry.generated.models.SourceTriggerEvent; +import com.azure.resourcemanager.containerregistry.generated.models.SourceTriggerUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.SourceUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Task; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStatus; +import com.azure.resourcemanager.containerregistry.generated.models.TokenType; +import com.azure.resourcemanager.containerregistry.generated.models.TriggerUpdateParameters; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Tasks Update. */ +public final class TasksUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_QuickTask.json + */ + /** + * Sample code: Tasks_Update_QuickTask. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksUpdateQuickTask( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Task resource = + manager + .tasks() + .getWithResponse("myResourceGroup", "myRegistry", "quicktask", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withLogTemplate("acr/tasks:{{.Run.OS}}") + .apply(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json + */ + /** + * Sample code: Tasks_Update_WithMSICustomCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksUpdateWithMSICustomCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Task resource = + manager + .tasks() + .getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withAgentConfiguration(new AgentProperties().withCpu(3)) + .withStep( + new DockerBuildStepUpdateParameters() + .withImageNames(Arrays.asList("azurerest:testtag1")) + .withDockerFilePath("src/DockerFile")) + .withTrigger( + new TriggerUpdateParameters() + .withSourceTriggers( + Arrays + .asList( + new SourceTriggerUpdateParameters() + .withSourceRepository( + new SourceUpdateParameters() + .withSourceControlAuthProperties( + new AuthInfoUpdateParameters() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger")))) + .withCredentials( + new Credentials() + .withCustomRegistries( + mapOf("myregistry.azurecr.io", new CustomRegistryCredentials().withIdentity("[system]")))) + .apply(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json + */ + /** + * Sample code: Tasks_Update_WithKeyVaultCustomCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksUpdateWithKeyVaultCustomCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Task resource = + manager + .tasks() + .getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withAgentConfiguration(new AgentProperties().withCpu(3)) + .withStep( + new DockerBuildStepUpdateParameters() + .withImageNames(Arrays.asList("azurerest:testtag1")) + .withDockerFilePath("src/DockerFile")) + .withTrigger( + new TriggerUpdateParameters() + .withSourceTriggers( + Arrays + .asList( + new SourceTriggerUpdateParameters() + .withSourceRepository( + new SourceUpdateParameters() + .withSourceControlAuthProperties( + new AuthInfoUpdateParameters() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger")))) + .withCredentials( + new Credentials() + .withCustomRegistries( + mapOf( + "myregistry.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject() + .withValue("https://myacbvault.vault.azure.net/secrets/username") + .withType(SecretObjectType.VAULTSECRET)) + .withPassword( + new SecretObject() + .withValue("https://myacbvault.vault.azure.net/secrets/password") + .withType(SecretObjectType.VAULTSECRET)) + .withIdentity("[system]")))) + .apply(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate.json + */ + /** + * Sample code: Tasks_Update. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Task resource = + manager + .tasks() + .getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withAgentConfiguration(new AgentProperties().withCpu(3)) + .withStep( + new DockerBuildStepUpdateParameters() + .withImageNames(Arrays.asList("azurerest:testtag1")) + .withDockerFilePath("src/DockerFile")) + .withTrigger( + new TriggerUpdateParameters() + .withSourceTriggers( + Arrays + .asList( + new SourceTriggerUpdateParameters() + .withSourceRepository( + new SourceUpdateParameters() + .withSourceControlAuthProperties( + new AuthInfoUpdateParameters() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger")))) + .withCredentials( + new Credentials() + .withCustomRegistries( + mapOf( + "myregistry.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject().withValue("username").withType(SecretObjectType.OPAQUE)) + .withPassword( + new SecretObject() + .withValue("https://myacbvault.vault.azure.net/secrets/password") + .withType(SecretObjectType.VAULTSECRET)) + .withIdentity("[system]")))) + .withLogTemplate("acr/tasks:{{.Run.OS}}") + .apply(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json + */ + /** + * Sample code: Tasks_Update_WithOpaqueCustomCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksUpdateWithOpaqueCustomCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Task resource = + manager + .tasks() + .getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withAgentConfiguration(new AgentProperties().withCpu(3)) + .withStep( + new DockerBuildStepUpdateParameters() + .withImageNames(Arrays.asList("azurerest:testtag1")) + .withDockerFilePath("src/DockerFile")) + .withTrigger( + new TriggerUpdateParameters() + .withSourceTriggers( + Arrays + .asList( + new SourceTriggerUpdateParameters() + .withSourceRepository( + new SourceUpdateParameters() + .withSourceControlAuthProperties( + new AuthInfoUpdateParameters() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger")))) + .withCredentials( + new Credentials() + .withCustomRegistries( + mapOf( + "myregistry.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject().withValue("username").withType(SecretObjectType.OPAQUE)) + .withPassword(new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Tokens_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificate; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificateName; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import java.util.Arrays; + +/** Samples for Tokens Create. */ +public final class TokensCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenCreate.json + */ + /** + * Sample code: TokenCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tokens() + .define("myToken") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withScopeMapId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap") + .withCredentials( + new TokenCredentialsProperties() + .withCertificates( + Arrays + .asList( + new TokenCertificate() + .withName(TokenCertificateName.CERTIFICATE1) + .withEncodedPemCertificate("fakeTokenPlaceholder")))) + .withStatus(TokenStatus.DISABLED) + .create(); + } +} +``` + +### Tokens_Delete + +```java +/** Samples for Tokens Delete. */ +public final class TokensDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenDelete.json + */ + /** + * Sample code: TokenDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().delete("myResourceGroup", "myRegistry", "myToken", com.azure.core.util.Context.NONE); + } +} +``` + +### Tokens_Get + +```java +/** Samples for Tokens Get. */ +public final class TokensGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenGet.json + */ + /** + * Sample code: TokenGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().getWithResponse("myResourceGroup", "myRegistry", "myToken", com.azure.core.util.Context.NONE); + } +} +``` + +### Tokens_List + +```java +/** Samples for Tokens List. */ +public final class TokensListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenList.json + */ + /** + * Sample code: TokenList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Tokens_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.Token; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificate; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificateName; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import java.util.Arrays; + +/** Samples for Tokens Update. */ +public final class TokensUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenUpdate.json + */ + /** + * Sample code: TokenUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Token resource = + manager + .tokens() + .getWithResponse("myResourceGroup", "myRegistry", "myToken", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withScopeMapId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap") + .withCredentials( + new TokenCredentialsProperties() + .withCertificates( + Arrays + .asList( + new TokenCertificate() + .withName(TokenCertificateName.CERTIFICATE1) + .withEncodedPemCertificate("fakeTokenPlaceholder")))) + .apply(); + } +} +``` + +### Webhooks_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Webhooks Create. */ +public final class WebhooksCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookCreate.json + */ + /** + * Sample code: WebhookCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .webhooks() + .define("myWebhook") + .withRegion("westus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withServiceUri("http://myservice.com") + .withCustomHeaders(mapOf("Authorization", "fakeTokenPlaceholder")) + .withStatus(WebhookStatus.ENABLED) + .withScope("myRepository") + .withActions(Arrays.asList(WebhookAction.PUSH)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Webhooks_Delete + +```java +/** Samples for Webhooks Delete. */ +public final class WebhooksDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookDelete.json + */ + /** + * Sample code: WebhookDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().delete("myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE); + } +} +``` + +### Webhooks_Get + +```java +/** Samples for Webhooks Get. */ +public final class WebhooksGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookGet.json + */ + /** + * Sample code: WebhookGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .webhooks() + .getWithResponse("myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE); + } +} +``` + +### Webhooks_GetCallbackConfig + +```java +/** Samples for Webhooks GetCallbackConfig. */ +public final class WebhooksGetCallbackConfigSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookGetCallbackConfig.json + */ + /** + * Sample code: WebhookGetCallbackConfig. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookGetCallbackConfig( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .webhooks() + .getCallbackConfigWithResponse( + "myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE); + } +} +``` + +### Webhooks_List + +```java +/** Samples for Webhooks List. */ +public final class WebhooksListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookList.json + */ + /** + * Sample code: WebhookList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} +``` + +### Webhooks_ListEvents + +```java +/** Samples for Webhooks ListEvents. */ +public final class WebhooksListEventsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookListEvents.json + */ + /** + * Sample code: WebhookListEvents. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookListEvents( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().listEvents("myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE); + } +} +``` + +### Webhooks_Ping + +```java +/** Samples for Webhooks Ping. */ +public final class WebhooksPingSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookPing.json + */ + /** + * Sample code: WebhookPing. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookPing( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .webhooks() + .pingWithResponse("myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE); + } +} +``` + +### Webhooks_Update + +```java +import com.azure.resourcemanager.containerregistry.generated.models.Webhook; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Webhooks Update. */ +public final class WebhooksUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookUpdate.json + */ + /** + * Sample code: WebhookUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Webhook resource = + manager + .webhooks() + .getWithResponse("myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withServiceUri("http://myservice.com") + .withCustomHeaders(mapOf("Authorization", "fakeTokenPlaceholder")) + .withStatus(WebhookStatus.ENABLED) + .withScope("myRepository") + .withActions(Arrays.asList(WebhookAction.PUSH)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + 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..87267a2eb0151 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/pom.xml @@ -0,0 +1,62 @@ + + + 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-2023-11-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 + 0 + 0 + true + + + + com.azure + azure-core + 1.43.0 + + + com.azure + azure-core-management + 1.11.5 + + + 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..23a21dc810df4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/ContainerRegistryManager.java @@ -0,0 +1,573 @@ +// Copyright (c) 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.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +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.RetryOptions; +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.ArchiveVersionsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ArchivesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.CacheRulesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ConnectedRegistriesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ContainerRegistryManagementClientBuilder; +import com.azure.resourcemanager.containerregistry.generated.implementation.CredentialSetsImpl; +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.ArchiveVersions; +import com.azure.resourcemanager.containerregistry.generated.models.Archives; +import com.azure.resourcemanager.containerregistry.generated.models.CacheRules; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistries; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialSets; +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; +import java.util.stream.Collectors; + +/** Entry point to ContainerRegistryManager. */ +public final class ContainerRegistryManager { + private Archives archives; + + private ArchiveVersions archiveVersions; + + private CacheRules cacheRules; + + private ConnectedRegistries connectedRegistries; + + private CredentialSets credentialSets; + + 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); + } + + /** + * Creates an instance of ContainerRegistry service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ContainerRegistry service API instance. + */ + public static ContainerRegistryManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ContainerRegistryManager(httpPipeline, profile, null); + } + + /** + * 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 static 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 RetryOptions retryOptions; + 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 retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' 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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + 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); + } + } + + /** + * Gets the resource collection API of Archives. It manages Archive. + * + * @return Resource collection API of Archives. + */ + public Archives archives() { + if (this.archives == null) { + this.archives = new ArchivesImpl(clientObject.getArchives(), this); + } + return archives; + } + + /** + * Gets the resource collection API of ArchiveVersions. + * + * @return Resource collection API of ArchiveVersions. + */ + public ArchiveVersions archiveVersions() { + if (this.archiveVersions == null) { + this.archiveVersions = new ArchiveVersionsImpl(clientObject.getArchiveVersions(), this); + } + return archiveVersions; + } + + /** + * Gets the resource collection API of CacheRules. It manages CacheRule. + * + * @return Resource collection API of CacheRules. + */ + public CacheRules cacheRules() { + if (this.cacheRules == null) { + this.cacheRules = new CacheRulesImpl(clientObject.getCacheRules(), this); + } + return cacheRules; + } + + /** + * Gets the resource collection API of ConnectedRegistries. It manages ConnectedRegistry. + * + * @return Resource collection API of ConnectedRegistries. + */ + public ConnectedRegistries connectedRegistries() { + if (this.connectedRegistries == null) { + this.connectedRegistries = new ConnectedRegistriesImpl(clientObject.getConnectedRegistries(), this); + } + return connectedRegistries; + } + + /** + * Gets the resource collection API of CredentialSets. It manages CredentialSet. + * + * @return Resource collection API of CredentialSets. + */ + public CredentialSets credentialSets() { + if (this.credentialSets == null) { + this.credentialSets = new CredentialSetsImpl(clientObject.getCredentialSets(), this); + } + return credentialSets; + } + + /** + * Gets the resource collection API of ExportPipelines. It manages ExportPipeline. + * + * @return Resource collection API of ExportPipelines. + */ + public ExportPipelines exportPipelines() { + if (this.exportPipelines == null) { + this.exportPipelines = new ExportPipelinesImpl(clientObject.getExportPipelines(), this); + } + return exportPipelines; + } + + /** + * Gets the resource collection API of Registries. It manages Registry. + * + * @return Resource collection API of Registries. + */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(clientObject.getRegistries(), this); + } + return registries; + } + + /** + * Gets the resource collection API of ImportPipelines. It manages ImportPipeline. + * + * @return Resource collection API of ImportPipelines. + */ + public ImportPipelines importPipelines() { + if (this.importPipelines == null) { + this.importPipelines = new ImportPipelinesImpl(clientObject.getImportPipelines(), this); + } + return importPipelines; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of PipelineRuns. It manages PipelineRun. + * + * @return Resource collection API of PipelineRuns. + */ + public PipelineRuns pipelineRuns() { + if (this.pipelineRuns == null) { + this.pipelineRuns = new PipelineRunsImpl(clientObject.getPipelineRuns(), this); + } + return pipelineRuns; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of Replications. It manages Replication. + * + * @return Resource collection API of Replications. + */ + public Replications replications() { + if (this.replications == null) { + this.replications = new ReplicationsImpl(clientObject.getReplications(), this); + } + return replications; + } + + /** + * Gets the resource collection API of ScopeMaps. It manages ScopeMap. + * + * @return Resource collection API of ScopeMaps. + */ + public ScopeMaps scopeMaps() { + if (this.scopeMaps == null) { + this.scopeMaps = new ScopeMapsImpl(clientObject.getScopeMaps(), this); + } + return scopeMaps; + } + + /** + * Gets the resource collection API of Tokens. It manages Token. + * + * @return Resource collection API of Tokens. + */ + public Tokens tokens() { + if (this.tokens == null) { + this.tokens = new TokensImpl(clientObject.getTokens(), this); + } + return tokens; + } + + /** + * Gets the resource collection API of Webhooks. It manages Webhook. + * + * @return Resource collection API of Webhooks. + */ + public Webhooks webhooks() { + if (this.webhooks == null) { + this.webhooks = new WebhooksImpl(clientObject.getWebhooks(), this); + } + return webhooks; + } + + /** + * Gets the resource collection API of AgentPools. It manages AgentPool. + * + * @return Resource collection API of AgentPools. + */ + public AgentPools agentPools() { + if (this.agentPools == null) { + this.agentPools = new AgentPoolsImpl(clientObject.getAgentPools(), this); + } + return agentPools; + } + + /** + * Gets the resource collection API of Runs. + * + * @return Resource collection API of Runs. + */ + public Runs runs() { + if (this.runs == null) { + this.runs = new RunsImpl(clientObject.getRuns(), this); + } + return runs; + } + + /** + * Gets the resource collection API of TaskRuns. It manages TaskRun. + * + * @return Resource collection API of TaskRuns. + */ + public TaskRuns taskRuns() { + if (this.taskRuns == null) { + this.taskRuns = new TaskRunsImpl(clientObject.getTaskRuns(), this); + } + return taskRuns; + } + + /** + * Gets the resource collection API of Tasks. It manages Task. + * + * @return Resource collection API of Tasks. + */ + public Tasks tasks() { + if (this.tasks == null) { + this.tasks = new TasksImpl(clientObject.getTasks(), this); + } + return tasks; + } + + /** + * Gets wrapped service client ContainerRegistryManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client ContainerRegistryManagementClient. + */ + 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..cded1e0a14006 --- /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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String agentPoolName, 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 com.azure.core.management.exception.ManagementException 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); + + /** + * 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 {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getQueueStatusWithResponse( + String resourceGroupName, String registryName, String agentPoolName, 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); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ArchiveVersionsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ArchiveVersionsClient.java new file mode 100644 index 0000000000000..0e1639cb72c8c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ArchiveVersionsClient.java @@ -0,0 +1,272 @@ +// Copyright (c) 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.ArchiveVersionInner; + +/** An instance of this class provides access to all the operations defined in ArchiveVersionsClient. */ +public interface ArchiveVersionsClient { + /** + * Lists all archive versions for the specified container registry, repository type and archive name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String packageType, String archiveName); + + /** + * Lists all archive versions for the specified container registry, repository type and archive name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context); + + /** + * Gets the properties of the archive version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @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 archive version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context); + + /** + * Gets the properties of the archive version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 archive version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArchiveVersionInner get( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName); + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArchiveVersionInner> beginCreate( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName); + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @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 {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArchiveVersionInner> beginCreate( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context); + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ArchiveVersionInner create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName); + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @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) + ArchiveVersionInner create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context); + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName); + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context); + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 packageType, + String archiveName, + String archiveVersionName); + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @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 packageType, + String archiveName, + String archiveVersionName, + Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ArchivesClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ArchivesClient.java new file mode 100644 index 0000000000000..2d040b745c3ee --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ArchivesClient.java @@ -0,0 +1,276 @@ +// Copyright (c) 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.ArchiveInner; +import com.azure.resourcemanager.containerregistry.generated.models.ArchiveUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ArchivesClient. */ +public interface ArchivesClient { + /** + * Lists all archives for the specified container registry and package type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 archives for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String packageType); + + /** + * Lists all archives for the specified container registry and package type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @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 archives for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String packageType, Context context); + + /** + * Gets the properties of the archive. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @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 archive along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context); + + /** + * Gets the properties of the archive. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArchiveInner get(String resourceGroupName, String registryName, String packageType, String archiveName); + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArchiveInner> beginCreate( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters); + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @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 {@link SyncPoller} for polling of an object that represents a archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArchiveInner> beginCreate( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters, + Context context); + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArchiveInner create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters); + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @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 archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArchiveInner create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters, + Context context); + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String packageType, String archiveName); + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context); + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 packageType, String archiveName); + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @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 packageType, String archiveName, Context context); + + /** + * Updates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveUpdateParameters The parameters for updating a archive. + * @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 archive for a container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveUpdateParameters archiveUpdateParameters, + Context context); + + /** + * Updates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveUpdateParameters The parameters for updating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArchiveInner update( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveUpdateParameters archiveUpdateParameters); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/CacheRulesClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/CacheRulesClient.java new file mode 100644 index 0000000000000..a1c9ab9e60f59 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/CacheRulesClient.java @@ -0,0 +1,288 @@ +// Copyright (c) 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.CacheRuleInner; +import com.azure.resourcemanager.containerregistry.generated.models.CacheRuleUpdateParameters; + +/** An instance of this class provides access to all the operations defined in CacheRulesClient. */ +public interface CacheRulesClient { + /** + * Lists all cache rule resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 cache rules for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all cache rule resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 cache rules for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified cache rule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @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 cache rule resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String cacheRuleName, Context context); + + /** + * Gets the properties of the specified cache rule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cache rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CacheRuleInner get(String resourceGroupName, String registryName, String cacheRuleName); + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CacheRuleInner> beginCreate( + String resourceGroupName, String registryName, String cacheRuleName, CacheRuleInner cacheRuleCreateParameters); + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @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 {@link SyncPoller} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CacheRuleInner> beginCreate( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleInner cacheRuleCreateParameters, + Context context); + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CacheRuleInner create( + String resourceGroupName, String registryName, String cacheRuleName, CacheRuleInner cacheRuleCreateParameters); + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @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 cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CacheRuleInner create( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleInner cacheRuleCreateParameters, + Context context); + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String cacheRuleName); + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String cacheRuleName, Context context); + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cacheRuleName); + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @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 cacheRuleName, Context context); + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CacheRuleInner> beginUpdate( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters); + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @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 {@link SyncPoller} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CacheRuleInner> beginUpdate( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters, + Context context); + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CacheRuleInner update( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters); + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @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 cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CacheRuleInner update( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters, + 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..d46e5cbbe9885 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ConnectedRegistriesClient.java @@ -0,0 +1,361 @@ +// Copyright (c) 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 { + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context); + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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..7d11fd3cb7664 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ContainerRegistryManagementClient.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; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ContainerRegistryManagementClient class. */ +public interface ContainerRegistryManagementClient { + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @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 ArchivesClient object to access its operations. + * + * @return the ArchivesClient object. + */ + ArchivesClient getArchives(); + + /** + * Gets the ArchiveVersionsClient object to access its operations. + * + * @return the ArchiveVersionsClient object. + */ + ArchiveVersionsClient getArchiveVersions(); + + /** + * Gets the CacheRulesClient object to access its operations. + * + * @return the CacheRulesClient object. + */ + CacheRulesClient getCacheRules(); + + /** + * Gets the ConnectedRegistriesClient object to access its operations. + * + * @return the ConnectedRegistriesClient object. + */ + ConnectedRegistriesClient getConnectedRegistries(); + + /** + * Gets the CredentialSetsClient object to access its operations. + * + * @return the CredentialSetsClient object. + */ + CredentialSetsClient getCredentialSets(); + + /** + * 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/CredentialSetsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/CredentialSetsClient.java new file mode 100644 index 0000000000000..6b228da9ef122 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/CredentialSetsClient.java @@ -0,0 +1,299 @@ +// Copyright (c) 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.CredentialSetInner; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialSetUpdateParameters; + +/** An instance of this class provides access to all the operations defined in CredentialSetsClient. */ +public interface CredentialSetsClient { + /** + * Lists all credential set resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 credential sets for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all credential set resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 credential sets for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified credential set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @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 credential set resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String credentialSetName, Context context); + + /** + * Gets the properties of the specified credential set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 credential set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialSetInner get(String resourceGroupName, String registryName, String credentialSetName); + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CredentialSetInner> beginCreate( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters); + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @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 {@link SyncPoller} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CredentialSetInner> beginCreate( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters, + Context context); + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 credential set resource for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialSetInner create( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters); + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @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 credential set resource for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialSetInner create( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters, + Context context); + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String credentialSetName); + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String credentialSetName, Context context); + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 credentialSetName); + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @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 credentialSetName, Context context); + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CredentialSetInner> beginUpdate( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters); + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @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 {@link SyncPoller} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CredentialSetInner> beginUpdate( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters, + Context context); + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 credential set resource for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialSetInner update( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters); + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @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 credential set resource for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialSetInner update( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters, + Context context); +} 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..0d8f0e1c468ea --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ExportPipelinesClient.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.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 { + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); +} 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..5aec903a5162f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ImportPipelinesClient.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.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 { + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); +} 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..1c30626832d4d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/OperationsClient.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.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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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..13ede63a66665 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PipelineRunsClient.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.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 { + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); +} 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..8bcd819972a2e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,218 @@ +// Copyright (c) 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 { + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated + * response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); +} 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..c66b77d27304b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RegistriesClient.java @@ -0,0 +1,680 @@ +// Copyright (c) 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. + * @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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName); + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, Context context); + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response + * with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context); + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @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 private link resource by a specified group name for a container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPrivateLinkResourceWithResponse( + String resourceGroupName, String registryName, String groupName, Context context); + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 private link resource by a specified group name for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner getPrivateLinkResource(String resourceGroupName, String registryName, String groupName); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuildSourceUploadUrlWithResponse( + String resourceGroupName, String registryName, 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); +} 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..b35aa0f85af32 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ReplicationsClient.java @@ -0,0 +1,289 @@ +// Copyright (c) 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 { + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); +} 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..851fdc78dbc1e --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, String runId, 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); + + /** + * 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 the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogSasUrlWithResponse( + String resourceGroupName, String registryName, String runId, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..2a1e0d731dd2e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ScopeMapsClient.java @@ -0,0 +1,288 @@ +// Copyright (c) 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 { + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); +} 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..154c06cda9179 --- /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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String taskRunName, 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 com.azure.core.management.exception.ManagementException 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); + + /** + * 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 {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDetailsWithResponse( + 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskRunInner getDetails(String resourceGroupName, String registryName, String taskRunName); + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..46c2e03f3c506 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String taskName, 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); + + /** + * 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 {@link SyncPoller} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDetailsWithResponse( + 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskInner getDetails(String resourceGroupName, String registryName, String taskName); +} 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..5ffaf51b33e77 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TokensClient.java @@ -0,0 +1,282 @@ +// Copyright (c) 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 { + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String tokenName); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); +} 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..70766b6ea8f96 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/WebhooksClient.java @@ -0,0 +1,388 @@ +// Copyright (c) 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 { + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String webhookName); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listEvents( + 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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCallbackConfigWithResponse( + 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. The name is case insensitive. + * @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); +} 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..1161f8d5b3127 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +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. + */ +@Fluent +public final class AgentPoolInner extends Resource { + /* + * The properties associated with the agent pool + */ + @JsonProperty(value = "properties") + private AgentPoolProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of AgentPoolInner class. */ + public AgentPoolInner() { + } + + /** + * Get the innerProperties property: The properties associated with the agent pool. + * + * @return the innerProperties value. + */ + private AgentPoolProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the count property: The count of agent machine. + * + * @return the count value. + */ + public Integer count() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolProperties(); + } + this.innerProperties().withCount(count); + return this; + } + + /** + * Get the tier property: The Tier of agent machine. + * + * @return the tier value. + */ + public String tier() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolProperties(); + } + this.innerProperties().withTier(tier); + return this; + } + + /** + * Get the os property: The OS of agent machine. + * + * @return the os value. + */ + public OS os() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolProperties(); + } + this.innerProperties().withOs(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolProperties(); + } + this.innerProperties().withVirtualNetworkSubnetResourceId(virtualNetworkSubnetResourceId); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of this agent pool. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolProperties.java new file mode 100644 index 0000000000000..76a0c7ec17853 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of agent pool. */ +@Fluent +public final class AgentPoolProperties { + /* + * The count of agent machine + */ + @JsonProperty(value = "count") + private Integer count; + + /* + * The Tier of agent machine + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * The OS of agent machine + */ + @JsonProperty(value = "os") + private OS os; + + /* + * The Virtual Network Subnet Resource Id of the agent machine + */ + @JsonProperty(value = "virtualNetworkSubnetResourceId") + private String virtualNetworkSubnetResourceId; + + /* + * The provisioning state of this agent pool + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of AgentPoolProperties class. */ + public AgentPoolProperties() { + } + + /** + * 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 AgentPoolProperties object itself. + */ + public AgentPoolProperties 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 AgentPoolProperties object itself. + */ + public AgentPoolProperties 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 AgentPoolProperties object itself. + */ + public AgentPoolProperties 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 AgentPoolProperties object itself. + */ + public AgentPoolProperties 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; + } + + /** + * 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/AgentPoolPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..4d50323307bf0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/AgentPoolPropertiesUpdateParameters.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.fasterxml.jackson.annotation.JsonProperty; + +/** The AgentPoolPropertiesUpdateParameters model. */ +@Fluent +public final class AgentPoolPropertiesUpdateParameters { + /* + * The count of agent machine + */ + @JsonProperty(value = "count") + private Integer count; + + /** Creates an instance of AgentPoolPropertiesUpdateParameters class. */ + public AgentPoolPropertiesUpdateParameters() { + } + + /** + * 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 AgentPoolPropertiesUpdateParameters object itself. + */ + public AgentPoolPropertiesUpdateParameters 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/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..55d724a7d959d --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The QueueStatus of Agent Pool. */ +@Fluent +public final class AgentPoolQueueStatusInner { + /* + * The number of pending runs in the queue + */ + @JsonProperty(value = "count") + private Integer count; + + /** Creates an instance of AgentPoolQueueStatusInner class. */ + public AgentPoolQueueStatusInner() { + } + + /** + * 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/ArchiveInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveInner.java new file mode 100644 index 0000000000000..376d95964c8dc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveInner.java @@ -0,0 +1,148 @@ +// Copyright (c) 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.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.ArchivePackageSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that represents a archive for a container registry. */ +@Fluent +public final class ArchiveInner extends ProxyResource { + /* + * The properties of the archive. + */ + @JsonProperty(value = "properties") + private ArchiveProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ArchiveInner class. */ + public ArchiveInner() { + } + + /** + * Get the innerProperties property: The properties of the archive. + * + * @return the innerProperties value. + */ + private ArchiveProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the packageSource property: The package source of the archive. + * + * @return the packageSource value. + */ + public ArchivePackageSourceProperties packageSource() { + return this.innerProperties() == null ? null : this.innerProperties().packageSource(); + } + + /** + * Set the packageSource property: The package source of the archive. + * + * @param packageSource the packageSource value to set. + * @return the ArchiveInner object itself. + */ + public ArchiveInner withPackageSource(ArchivePackageSourceProperties packageSource) { + if (this.innerProperties() == null) { + this.innerProperties = new ArchiveProperties(); + } + this.innerProperties().withPackageSource(packageSource); + return this; + } + + /** + * Get the publishedVersion property: The published version of the archive. + * + * @return the publishedVersion value. + */ + public String publishedVersion() { + return this.innerProperties() == null ? null : this.innerProperties().publishedVersion(); + } + + /** + * Set the publishedVersion property: The published version of the archive. + * + * @param publishedVersion the publishedVersion value to set. + * @return the ArchiveInner object itself. + */ + public ArchiveInner withPublishedVersion(String publishedVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ArchiveProperties(); + } + this.innerProperties().withPublishedVersion(publishedVersion); + return this; + } + + /** + * Get the repositoryEndpointPrefix property: The repositoryEndpointPrefix property. + * + * @return the repositoryEndpointPrefix value. + */ + public String repositoryEndpointPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().repositoryEndpointPrefix(); + } + + /** + * Set the repositoryEndpointPrefix property: The repositoryEndpointPrefix property. + * + * @param repositoryEndpointPrefix the repositoryEndpointPrefix value to set. + * @return the ArchiveInner object itself. + */ + public ArchiveInner withRepositoryEndpointPrefix(String repositoryEndpointPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new ArchiveProperties(); + } + this.innerProperties().withRepositoryEndpointPrefix(repositoryEndpointPrefix); + return this; + } + + /** + * Get the repositoryEndpoint property: The repositoryEndpoint property. + * + * @return the repositoryEndpoint value. + */ + public String repositoryEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().repositoryEndpoint(); + } + + /** + * Get the provisioningState property: The provisioning state of the archive at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveProperties.java new file mode 100644 index 0000000000000..ac8b9c40d85cc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveProperties.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.resourcemanager.containerregistry.generated.models.ArchivePackageSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a archive. */ +@Fluent +public class ArchiveProperties { + /* + * The package source of the archive. + */ + @JsonProperty(value = "packageSource") + private ArchivePackageSourceProperties packageSource; + + /* + * The published version of the archive. + */ + @JsonProperty(value = "publishedVersion") + private String publishedVersion; + + /* + * The repositoryEndpointPrefix property. + */ + @JsonProperty(value = "repositoryEndpointPrefix") + private String repositoryEndpointPrefix; + + /* + * The repositoryEndpoint property. + */ + @JsonProperty(value = "repositoryEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String repositoryEndpoint; + + /* + * The provisioning state of the archive at the time the operation was called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of ArchiveProperties class. */ + public ArchiveProperties() { + } + + /** + * Get the packageSource property: The package source of the archive. + * + * @return the packageSource value. + */ + public ArchivePackageSourceProperties packageSource() { + return this.packageSource; + } + + /** + * Set the packageSource property: The package source of the archive. + * + * @param packageSource the packageSource value to set. + * @return the ArchiveProperties object itself. + */ + public ArchiveProperties withPackageSource(ArchivePackageSourceProperties packageSource) { + this.packageSource = packageSource; + return this; + } + + /** + * Get the publishedVersion property: The published version of the archive. + * + * @return the publishedVersion value. + */ + public String publishedVersion() { + return this.publishedVersion; + } + + /** + * Set the publishedVersion property: The published version of the archive. + * + * @param publishedVersion the publishedVersion value to set. + * @return the ArchiveProperties object itself. + */ + public ArchiveProperties withPublishedVersion(String publishedVersion) { + this.publishedVersion = publishedVersion; + return this; + } + + /** + * Get the repositoryEndpointPrefix property: The repositoryEndpointPrefix property. + * + * @return the repositoryEndpointPrefix value. + */ + public String repositoryEndpointPrefix() { + return this.repositoryEndpointPrefix; + } + + /** + * Set the repositoryEndpointPrefix property: The repositoryEndpointPrefix property. + * + * @param repositoryEndpointPrefix the repositoryEndpointPrefix value to set. + * @return the ArchiveProperties object itself. + */ + public ArchiveProperties withRepositoryEndpointPrefix(String repositoryEndpointPrefix) { + this.repositoryEndpointPrefix = repositoryEndpointPrefix; + return this; + } + + /** + * Get the repositoryEndpoint property: The repositoryEndpoint property. + * + * @return the repositoryEndpoint value. + */ + public String repositoryEndpoint() { + return this.repositoryEndpoint; + } + + /** + * Get the provisioningState property: The provisioning state of the archive at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (packageSource() != null) { + packageSource().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveUpdateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveUpdateProperties.java new file mode 100644 index 0000000000000..23d197c49910c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveUpdateProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a archive. */ +@Fluent +public final class ArchiveUpdateProperties { + /* + * The published version of the archive. + */ + @JsonProperty(value = "publishedVersion") + private String publishedVersion; + + /** Creates an instance of ArchiveUpdateProperties class. */ + public ArchiveUpdateProperties() { + } + + /** + * Get the publishedVersion property: The published version of the archive. + * + * @return the publishedVersion value. + */ + public String publishedVersion() { + return this.publishedVersion; + } + + /** + * Set the publishedVersion property: The published version of the archive. + * + * @param publishedVersion the publishedVersion value to set. + * @return the ArchiveUpdateProperties object itself. + */ + public ArchiveUpdateProperties withPublishedVersion(String publishedVersion) { + this.publishedVersion = publishedVersion; + 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/ArchiveVersionInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveVersionInner.java new file mode 100644 index 0000000000000..8dbfabba2e7dd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveVersionInner.java @@ -0,0 +1,94 @@ +// Copyright (c) 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.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that represents an export pipeline for a container registry. */ +@Fluent +public final class ArchiveVersionInner extends ProxyResource { + /* + * The properties of the archive. + */ + @JsonProperty(value = "properties") + private ArchiveVersionProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ArchiveVersionInner class. */ + public ArchiveVersionInner() { + } + + /** + * Get the innerProperties property: The properties of the archive. + * + * @return the innerProperties value. + */ + private ArchiveVersionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning state of the archive at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the archiveVersionErrorMessage property: The detailed error message for the archive version in the case of + * failure. + * + * @return the archiveVersionErrorMessage value. + */ + public String archiveVersionErrorMessage() { + return this.innerProperties() == null ? null : this.innerProperties().archiveVersionErrorMessage(); + } + + /** + * Set the archiveVersionErrorMessage property: The detailed error message for the archive version in the case of + * failure. + * + * @param archiveVersionErrorMessage the archiveVersionErrorMessage value to set. + * @return the ArchiveVersionInner object itself. + */ + public ArchiveVersionInner withArchiveVersionErrorMessage(String archiveVersionErrorMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new ArchiveVersionProperties(); + } + this.innerProperties().withArchiveVersionErrorMessage(archiveVersionErrorMessage); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveVersionProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveVersionProperties.java new file mode 100644 index 0000000000000..1b1a79cf5ddac --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ArchiveVersionProperties.java @@ -0,0 +1,68 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an export pipeline. */ +@Fluent +public final class ArchiveVersionProperties { + /* + * The provisioning state of the archive at the time the operation was called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The detailed error message for the archive version in the case of failure. + */ + @JsonProperty(value = "archiveVersionErrorMessage") + private String archiveVersionErrorMessage; + + /** Creates an instance of ArchiveVersionProperties class. */ + public ArchiveVersionProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the archive at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the archiveVersionErrorMessage property: The detailed error message for the archive version in the case of + * failure. + * + * @return the archiveVersionErrorMessage value. + */ + public String archiveVersionErrorMessage() { + return this.archiveVersionErrorMessage; + } + + /** + * Set the archiveVersionErrorMessage property: The detailed error message for the archive version in the case of + * failure. + * + * @param archiveVersionErrorMessage the archiveVersionErrorMessage value to set. + * @return the ArchiveVersionProperties object itself. + */ + public ArchiveVersionProperties withArchiveVersionErrorMessage(String archiveVersionErrorMessage) { + this.archiveVersionErrorMessage = archiveVersionErrorMessage; + 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/CacheRuleInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CacheRuleInner.java new file mode 100644 index 0000000000000..95336d76d91bc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CacheRuleInner.java @@ -0,0 +1,152 @@ +// Copyright (c) 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.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** An object that represents a cache rule for a container registry. */ +@Fluent +public final class CacheRuleInner extends ProxyResource { + /* + * The properties of the cache rule. + */ + @JsonProperty(value = "properties") + private CacheRuleProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of CacheRuleInner class. */ + public CacheRuleInner() { + } + + /** + * Get the innerProperties property: The properties of the cache rule. + * + * @return the innerProperties value. + */ + private CacheRuleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the credentialSetResourceId property: The ARM resource ID of the credential store which is associated with + * the cache rule. + * + * @return the credentialSetResourceId value. + */ + public String credentialSetResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().credentialSetResourceId(); + } + + /** + * Set the credentialSetResourceId property: The ARM resource ID of the credential store which is associated with + * the cache rule. + * + * @param credentialSetResourceId the credentialSetResourceId value to set. + * @return the CacheRuleInner object itself. + */ + public CacheRuleInner withCredentialSetResourceId(String credentialSetResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new CacheRuleProperties(); + } + this.innerProperties().withCredentialSetResourceId(credentialSetResourceId); + return this; + } + + /** + * Get the sourceRepository property: Source repository pulled from upstream. + * + * @return the sourceRepository value. + */ + public String sourceRepository() { + return this.innerProperties() == null ? null : this.innerProperties().sourceRepository(); + } + + /** + * Set the sourceRepository property: Source repository pulled from upstream. + * + * @param sourceRepository the sourceRepository value to set. + * @return the CacheRuleInner object itself. + */ + public CacheRuleInner withSourceRepository(String sourceRepository) { + if (this.innerProperties() == null) { + this.innerProperties = new CacheRuleProperties(); + } + this.innerProperties().withSourceRepository(sourceRepository); + return this; + } + + /** + * Get the targetRepository property: Target repository specified in docker pull command. Eg: docker pull + * myregistry.azurecr.io/{targetRepository}:{tag}. + * + * @return the targetRepository value. + */ + public String targetRepository() { + return this.innerProperties() == null ? null : this.innerProperties().targetRepository(); + } + + /** + * Set the targetRepository property: Target repository specified in docker pull command. Eg: docker pull + * myregistry.azurecr.io/{targetRepository}:{tag}. + * + * @param targetRepository the targetRepository value to set. + * @return the CacheRuleInner object itself. + */ + public CacheRuleInner withTargetRepository(String targetRepository) { + if (this.innerProperties() == null) { + this.innerProperties = new CacheRuleProperties(); + } + this.innerProperties().withTargetRepository(targetRepository); + return this; + } + + /** + * Get the creationDate property: The creation date of the cache rule. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CacheRuleProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CacheRuleProperties.java new file mode 100644 index 0000000000000..d96cf7b67d943 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CacheRuleProperties.java @@ -0,0 +1,139 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The properties of a cache rule. */ +@Fluent +public final class CacheRuleProperties { + /* + * The ARM resource ID of the credential store which is associated with the cache rule. + */ + @JsonProperty(value = "credentialSetResourceId") + private String credentialSetResourceId; + + /* + * Source repository pulled from upstream. + */ + @JsonProperty(value = "sourceRepository") + private String sourceRepository; + + /* + * Target repository specified in docker pull command. + * Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag} + */ + @JsonProperty(value = "targetRepository") + private String targetRepository; + + /* + * The creation date of the cache rule. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of CacheRuleProperties class. */ + public CacheRuleProperties() { + } + + /** + * Get the credentialSetResourceId property: The ARM resource ID of the credential store which is associated with + * the cache rule. + * + * @return the credentialSetResourceId value. + */ + public String credentialSetResourceId() { + return this.credentialSetResourceId; + } + + /** + * Set the credentialSetResourceId property: The ARM resource ID of the credential store which is associated with + * the cache rule. + * + * @param credentialSetResourceId the credentialSetResourceId value to set. + * @return the CacheRuleProperties object itself. + */ + public CacheRuleProperties withCredentialSetResourceId(String credentialSetResourceId) { + this.credentialSetResourceId = credentialSetResourceId; + return this; + } + + /** + * Get the sourceRepository property: Source repository pulled from upstream. + * + * @return the sourceRepository value. + */ + public String sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the sourceRepository property: Source repository pulled from upstream. + * + * @param sourceRepository the sourceRepository value to set. + * @return the CacheRuleProperties object itself. + */ + public CacheRuleProperties withSourceRepository(String sourceRepository) { + this.sourceRepository = sourceRepository; + return this; + } + + /** + * Get the targetRepository property: Target repository specified in docker pull command. Eg: docker pull + * myregistry.azurecr.io/{targetRepository}:{tag}. + * + * @return the targetRepository value. + */ + public String targetRepository() { + return this.targetRepository; + } + + /** + * Set the targetRepository property: Target repository specified in docker pull command. Eg: docker pull + * myregistry.azurecr.io/{targetRepository}:{tag}. + * + * @param targetRepository the targetRepository value to set. + * @return the CacheRuleProperties object itself. + */ + public CacheRuleProperties withTargetRepository(String targetRepository) { + this.targetRepository = targetRepository; + return this; + } + + /** + * Get the creationDate property: The creation date of the cache rule. + * + * @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; + } + + /** + * 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/CacheRuleUpdateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CacheRuleUpdateProperties.java new file mode 100644 index 0000000000000..505412047fbaa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CacheRuleUpdateProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating cache rule properties. */ +@Fluent +public final class CacheRuleUpdateProperties { + /* + * The ARM resource ID of the credential store which is associated with the Cache rule. + */ + @JsonProperty(value = "credentialSetResourceId") + private String credentialSetResourceId; + + /** Creates an instance of CacheRuleUpdateProperties class. */ + public CacheRuleUpdateProperties() { + } + + /** + * Get the credentialSetResourceId property: The ARM resource ID of the credential store which is associated with + * the Cache rule. + * + * @return the credentialSetResourceId value. + */ + public String credentialSetResourceId() { + return this.credentialSetResourceId; + } + + /** + * Set the credentialSetResourceId property: The ARM resource ID of the credential store which is associated with + * the Cache rule. + * + * @param credentialSetResourceId the credentialSetResourceId value to set. + * @return the CacheRuleUpdateProperties object itself. + */ + public CacheRuleUpdateProperties withCredentialSetResourceId(String credentialSetResourceId) { + this.credentialSetResourceId = credentialSetResourceId; + 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..52b4e20909899 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CallbackConfigInner.java @@ -0,0 +1,87 @@ +// Copyright (c) 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.JsonInclude; +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 { + /* + * 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") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customHeaders; + + /** Creates an instance of CallbackConfigInner class. */ + public CallbackConfigInner() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CallbackConfigInner.class); +} 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..cd1e710be5623 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryInner.java @@ -0,0 +1,267 @@ +// Copyright (c) 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.management.ProxyResource; +import com.azure.core.management.SystemData; +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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** An object that represents a connected registry for a container registry. */ +@Fluent +public final class ConnectedRegistryInner extends ProxyResource { + /* + * The properties of the connected registry. + */ + @JsonProperty(value = "properties") + private ConnectedRegistryProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ConnectedRegistryInner class. */ + public ConnectedRegistryInner() { + } + + /** + * Get the innerProperties property: The properties of the connected registry. + * + * @return the innerProperties value. + */ + private ConnectedRegistryProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withMode(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.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the connectionState property: The current connection state of the connected registry. + * + * @return the connectionState value. + */ + public ConnectionState connectionState() { + return this.innerProperties() == null ? null : this.innerProperties().connectionState(); + } + + /** + * Get the lastActivityTime property: The last activity time of the connected registry. + * + * @return the lastActivityTime value. + */ + public OffsetDateTime lastActivityTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastActivityTime(); + } + + /** + * Get the activation property: The activation properties of the connected registry. + * + * @return the activation value. + */ + public ActivationProperties activation() { + return this.innerProperties() == null ? null : this.innerProperties().activation(); + } + + /** + * Get the parent property: The parent of the connected registry. + * + * @return the parent value. + */ + public ParentProperties parent() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withParent(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withClientTokenIds(clientTokenIds); + return this; + } + + /** + * Get the loginServer property: The login server properties of the connected registry. + * + * @return the loginServer value. + */ + public LoginServerProperties loginServer() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withLoginServer(loginServer); + return this; + } + + /** + * Get the logging property: The logging properties of the connected registry. + * + * @return the logging value. + */ + public LoggingProperties logging() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withLogging(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.innerProperties() == null ? null : this.innerProperties().statusDetails(); + } + + /** + * Get the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @return the notificationsList value. + */ + public List notificationsList() { + return this.innerProperties() == null ? null : this.innerProperties().notificationsList(); + } + + /** + * Set the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @param notificationsList the notificationsList value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withNotificationsList(List notificationsList) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withNotificationsList(notificationsList); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryProperties.java new file mode 100644 index 0000000000000..44442c0b54464 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryProperties.java @@ -0,0 +1,315 @@ +// Copyright (c) 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.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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a connected registry. */ +@Fluent +public final class ConnectedRegistryProperties { + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "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 = "mode", required = true) + private ConnectedRegistryMode mode; + + /* + * The current version of ACR runtime on the connected registry. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The current connection state of the connected registry. + */ + @JsonProperty(value = "connectionState", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionState connectionState; + + /* + * The last activity time of the connected registry. + */ + @JsonProperty(value = "lastActivityTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastActivityTime; + + /* + * The activation properties of the connected registry. + */ + @JsonProperty(value = "activation", access = JsonProperty.Access.WRITE_ONLY) + private ActivationProperties activation; + + /* + * The parent of the connected registry. + */ + @JsonProperty(value = "parent", required = true) + private ParentProperties parent; + + /* + * The list of the ACR token resource IDs used to authenticate clients to the connected registry. + */ + @JsonProperty(value = "clientTokenIds") + private List clientTokenIds; + + /* + * The login server properties of the connected registry. + */ + @JsonProperty(value = "loginServer") + private LoginServerProperties loginServer; + + /* + * The logging properties of the connected registry. + */ + @JsonProperty(value = "logging") + private LoggingProperties logging; + + /* + * The list of current statuses of the connected registry. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private List statusDetails; + + /* + * The list of notifications subscription information for the connected registry. + */ + @JsonProperty(value = "notificationsList") + private List notificationsList; + + /** Creates an instance of ConnectedRegistryProperties class. */ + public ConnectedRegistryProperties() { + } + + /** + * 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 ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties 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 ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties 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 ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties 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 ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties 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 ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties 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 notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @return the notificationsList value. + */ + public List notificationsList() { + return this.notificationsList; + } + + /** + * Set the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @param notificationsList the notificationsList value to set. + * @return the ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties withNotificationsList(List notificationsList) { + this.notificationsList = notificationsList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mode() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property mode in model ConnectedRegistryProperties")); + } + if (activation() != null) { + activation().validate(); + } + if (parent() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parent in model ConnectedRegistryProperties")); + } else { + parent().validate(); + } + if (loginServer() != null) { + loginServer().validate(); + } + if (logging() != null) { + logging().validate(); + } + if (statusDetails() != null) { + statusDetails().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectedRegistryProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryUpdateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryUpdateProperties.java new file mode 100644 index 0000000000000..16ef2c69f3b39 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryUpdateProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The parameters for updating token properties. */ +@Fluent +public final class ConnectedRegistryUpdateProperties { + /* + * The sync properties of the connected registry with its parent. + */ + @JsonProperty(value = "syncProperties") + private SyncUpdateProperties syncProperties; + + /* + * The logging properties of the connected registry. + */ + @JsonProperty(value = "logging") + private LoggingProperties logging; + + /* + * The list of the ACR token resource IDs used to authenticate clients to the connected registry. + */ + @JsonProperty(value = "clientTokenIds") + private List clientTokenIds; + + /* + * The list of notifications subscription information for the connected registry. + */ + @JsonProperty(value = "notificationsList") + private List notificationsList; + + /** Creates an instance of ConnectedRegistryUpdateProperties class. */ + public ConnectedRegistryUpdateProperties() { + } + + /** + * 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 ConnectedRegistryUpdateProperties object itself. + */ + public ConnectedRegistryUpdateProperties 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 ConnectedRegistryUpdateProperties object itself. + */ + public ConnectedRegistryUpdateProperties 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 ConnectedRegistryUpdateProperties object itself. + */ + public ConnectedRegistryUpdateProperties withClientTokenIds(List clientTokenIds) { + this.clientTokenIds = clientTokenIds; + return this; + } + + /** + * Get the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @return the notificationsList value. + */ + public List notificationsList() { + return this.notificationsList; + } + + /** + * Set the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @param notificationsList the notificationsList value to set. + * @return the ConnectedRegistryUpdateProperties object itself. + */ + public ConnectedRegistryUpdateProperties withNotificationsList(List notificationsList) { + this.notificationsList = notificationsList; + 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/fluent/models/CredentialSetInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetInner.java new file mode 100644 index 0000000000000..17ae509f389fe --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetInner.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.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.AuthCredential; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** An object that represents a credential set resource for a container registry. */ +@Fluent +public final class CredentialSetInner extends ProxyResource { + /* + * Identities associated with the resource. This is used to access the KeyVault secrets. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The properties of the credential set. + */ + @JsonProperty(value = "properties") + private CredentialSetProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of CredentialSetInner class. */ + public CredentialSetInner() { + } + + /** + * Get the identity property: Identities associated with the resource. This is used to access the KeyVault secrets. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: Identities associated with the resource. This is used to access the KeyVault secrets. + * + * @param identity the identity value to set. + * @return the CredentialSetInner object itself. + */ + public CredentialSetInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The properties of the credential set. + * + * @return the innerProperties value. + */ + private CredentialSetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the loginServer property: The credentials are stored for this upstream or login server. + * + * @return the loginServer value. + */ + public String loginServer() { + return this.innerProperties() == null ? null : this.innerProperties().loginServer(); + } + + /** + * Set the loginServer property: The credentials are stored for this upstream or login server. + * + * @param loginServer the loginServer value to set. + * @return the CredentialSetInner object itself. + */ + public CredentialSetInner withLoginServer(String loginServer) { + if (this.innerProperties() == null) { + this.innerProperties = new CredentialSetProperties(); + } + this.innerProperties().withLoginServer(loginServer); + return this; + } + + /** + * Get the authCredentials property: List of authentication credentials stored for an upstream. Usually consists of + * a primary and an optional secondary credential. + * + * @return the authCredentials value. + */ + public List authCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().authCredentials(); + } + + /** + * Set the authCredentials property: List of authentication credentials stored for an upstream. Usually consists of + * a primary and an optional secondary credential. + * + * @param authCredentials the authCredentials value to set. + * @return the CredentialSetInner object itself. + */ + public CredentialSetInner withAuthCredentials(List authCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new CredentialSetProperties(); + } + this.innerProperties().withAuthCredentials(authCredentials); + return this; + } + + /** + * Get the creationDate property: The creation date of credential store resource. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetProperties.java new file mode 100644 index 0000000000000..7b11ce28e3655 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.AuthCredential; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a credential set resource. */ +@Fluent +public final class CredentialSetProperties { + /* + * The credentials are stored for this upstream or login server. + */ + @JsonProperty(value = "loginServer") + private String loginServer; + + /* + * List of authentication credentials stored for an upstream. + * Usually consists of a primary and an optional secondary credential. + */ + @JsonProperty(value = "authCredentials") + private List authCredentials; + + /* + * The creation date of credential store resource. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of CredentialSetProperties class. */ + public CredentialSetProperties() { + } + + /** + * Get the loginServer property: The credentials are stored for this upstream or login server. + * + * @return the loginServer value. + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Set the loginServer property: The credentials are stored for this upstream or login server. + * + * @param loginServer the loginServer value to set. + * @return the CredentialSetProperties object itself. + */ + public CredentialSetProperties withLoginServer(String loginServer) { + this.loginServer = loginServer; + return this; + } + + /** + * Get the authCredentials property: List of authentication credentials stored for an upstream. Usually consists of + * a primary and an optional secondary credential. + * + * @return the authCredentials value. + */ + public List authCredentials() { + return this.authCredentials; + } + + /** + * Set the authCredentials property: List of authentication credentials stored for an upstream. Usually consists of + * a primary and an optional secondary credential. + * + * @param authCredentials the authCredentials value to set. + * @return the CredentialSetProperties object itself. + */ + public CredentialSetProperties withAuthCredentials(List authCredentials) { + this.authCredentials = authCredentials; + return this; + } + + /** + * Get the creationDate property: The creation date of credential store resource. + * + * @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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authCredentials() != null) { + authCredentials().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetUpdateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetUpdateProperties.java new file mode 100644 index 0000000000000..617579d30df89 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CredentialSetUpdateProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.AuthCredential; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The parameters for updating credential set properties. */ +@Fluent +public final class CredentialSetUpdateProperties { + /* + * List of authentication credentials stored for an upstream. + * Usually consists of a primary and an optional secondary credential. + */ + @JsonProperty(value = "authCredentials") + private List authCredentials; + + /** Creates an instance of CredentialSetUpdateProperties class. */ + public CredentialSetUpdateProperties() { + } + + /** + * Get the authCredentials property: List of authentication credentials stored for an upstream. Usually consists of + * a primary and an optional secondary credential. + * + * @return the authCredentials value. + */ + public List authCredentials() { + return this.authCredentials; + } + + /** + * Set the authCredentials property: List of authentication credentials stored for an upstream. Usually consists of + * a primary and an optional secondary credential. + * + * @param authCredentials the authCredentials value to set. + * @return the CredentialSetUpdateProperties object itself. + */ + public CredentialSetUpdateProperties withAuthCredentials(List authCredentials) { + this.authCredentials = authCredentials; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authCredentials() != null) { + authCredentials().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..333a773bb8e39 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The basic information of an event. */ +@Fluent +public class EventInfoInner { + /* + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of EventInfoInner class. */ + public EventInfoInner() { + } + + /** + * 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..bdc6c1067dbef --- /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.resourcemanager.containerregistry.generated.models.EventRequestMessage; +import com.azure.resourcemanager.containerregistry.generated.models.EventResponseMessage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The event for a webhook. */ +@Fluent +public final class EventInner extends EventInfoInner { + /* + * The event request message sent to the service URI. + */ + @JsonProperty(value = "eventRequestMessage") + private EventRequestMessage eventRequestMessage; + + /* + * The event response message received from the service URI. + */ + @JsonProperty(value = "eventResponseMessage") + private EventResponseMessage eventResponseMessage; + + /** Creates an instance of EventInner class. */ + public EventInner() { + } + + /** + * 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..7c2c7c75be9b9 --- /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.management.ProxyResource; +import com.azure.core.management.SystemData; +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.JsonProperty; +import java.util.List; + +/** An object that represents an export pipeline for a container registry. */ +@Fluent +public final class ExportPipelineInner extends ProxyResource { + /* + * 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 properties of the export pipeline. + */ + @JsonProperty(value = "properties") + private ExportPipelineProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ExportPipelineInner class. */ + public ExportPipelineInner() { + } + + /** + * 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 innerProperties property: The properties of the export pipeline. + * + * @return the innerProperties value. + */ + private ExportPipelineProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the target property: The target properties of the export pipeline. + * + * @return the target value. + */ + public ExportPipelineTargetProperties target() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExportPipelineProperties(); + } + this.innerProperties().withTarget(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExportPipelineProperties(); + } + this.innerProperties().withOptions(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineProperties.java new file mode 100644 index 0000000000000..90e55d042a925 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineProperties.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.azure.resourcemanager.containerregistry.generated.models.ExportPipelineTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of an export pipeline. */ +@Fluent +public final class ExportPipelineProperties { + /* + * The target properties of the export pipeline. + */ + @JsonProperty(value = "target", required = true) + private ExportPipelineTargetProperties target; + + /* + * The list of all options configured for the pipeline. + */ + @JsonProperty(value = "options") + private List options; + + /* + * The provisioning state of the pipeline at the time the operation was called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of ExportPipelineProperties class. */ + public ExportPipelineProperties() { + } + + /** + * 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 ExportPipelineProperties object itself. + */ + public ExportPipelineProperties 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 ExportPipelineProperties object itself. + */ + public ExportPipelineProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property target in model ExportPipelineProperties")); + } else { + target().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExportPipelineProperties.class); +} 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..590ca4852bda0 --- /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.resourcemanager.containerregistry.generated.models.TokenPassword; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the GenerateCredentials operation. */ +@Fluent +public final class GenerateCredentialsResultInner { + /* + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** Creates an instance of GenerateCredentialsResultInner class. */ + public GenerateCredentialsResultInner() { + } + + /** + * 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..51160ad4d3d1f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineInner.java @@ -0,0 +1,198 @@ +// Copyright (c) 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.management.ProxyResource; +import com.azure.core.management.SystemData; +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.JsonProperty; +import java.util.List; + +/** An object that represents an import pipeline for a container registry. */ +@Fluent +public final class ImportPipelineInner extends ProxyResource { + /* + * 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 properties of the import pipeline. + */ + @JsonProperty(value = "properties") + private ImportPipelineProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ImportPipelineInner class. */ + public ImportPipelineInner() { + } + + /** + * 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 innerProperties property: The properties of the import pipeline. + * + * @return the innerProperties value. + */ + private ImportPipelineProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the source property: The source properties of the import pipeline. + * + * @return the source value. + */ + public ImportPipelineSourceProperties source() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ImportPipelineProperties(); + } + this.innerProperties().withSource(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ImportPipelineProperties(); + } + this.innerProperties().withTrigger(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ImportPipelineProperties(); + } + this.innerProperties().withOptions(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineProperties.java new file mode 100644 index 0000000000000..67f184863dc73 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineProperties.java @@ -0,0 +1,135 @@ +// Copyright (c) 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.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.JsonProperty; +import java.util.List; + +/** The properties of an import pipeline. */ +@Fluent +public final class ImportPipelineProperties { + /* + * The source properties of the import pipeline. + */ + @JsonProperty(value = "source", required = true) + private ImportPipelineSourceProperties source; + + /* + * The properties that describe the trigger of the import pipeline. + */ + @JsonProperty(value = "trigger") + private PipelineTriggerProperties trigger; + + /* + * The list of all options configured for the pipeline. + */ + @JsonProperty(value = "options") + private List options; + + /* + * The provisioning state of the pipeline at the time the operation was called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of ImportPipelineProperties class. */ + public ImportPipelineProperties() { + } + + /** + * 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 ImportPipelineProperties object itself. + */ + public ImportPipelineProperties 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 ImportPipelineProperties object itself. + */ + public ImportPipelineProperties 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 ImportPipelineProperties object itself. + */ + public ImportPipelineProperties 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; + } + + /** + * 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 ImportPipelineProperties")); + } else { + source().validate(); + } + if (trigger() != null) { + trigger().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportPipelineProperties.class); +} 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..5a9d4cdeb596c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationDefinitionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.OperationDisplayDefinition; +import com.azure.resourcemanager.containerregistry.generated.models.OperationServiceSpecificationDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of a container registry operation. */ +@Fluent +public final class OperationDefinitionInner { + /* + * The origin information of the container registry operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display information for the container registry operation. + */ + @JsonProperty(value = "display") + private OperationDisplayDefinition display; + + /* + * The properties information for the container registry operation. + */ + @JsonProperty(value = "properties") + private OperationPropertiesDefinition innerProperties; + + /* + * 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; + + /** Creates an instance of OperationDefinitionInner class. */ + public OperationDefinitionInner() { + } + + /** + * 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 innerProperties property: The properties information for the container registry operation. + * + * @return the innerProperties value. + */ + private OperationPropertiesDefinition innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OperationPropertiesDefinition(); + } + this.innerProperties().withServiceSpecification(serviceSpecification); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationPropertiesDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationPropertiesDefinition.java new file mode 100644 index 0000000000000..3dd2b57b313dd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationPropertiesDefinition.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.resourcemanager.containerregistry.generated.models.OperationServiceSpecificationDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of Azure Monitoring properties. */ +@Fluent +public final class OperationPropertiesDefinition { + /* + * The definition of Azure Monitoring service. + */ + @JsonProperty(value = "serviceSpecification") + private OperationServiceSpecificationDefinition serviceSpecification; + + /** Creates an instance of OperationPropertiesDefinition class. */ + public OperationPropertiesDefinition() { + } + + /** + * 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 OperationPropertiesDefinition object itself. + */ + public OperationPropertiesDefinition withServiceSpecification( + OperationServiceSpecificationDefinition serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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..1b3d5412d9427 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +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.JsonProperty; + +/** An object that represents a pipeline run for a container registry. */ +@Fluent +public final class PipelineRunInner extends ProxyResource { + /* + * The properties of a pipeline run. + */ + @JsonProperty(value = "properties") + private PipelineRunProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PipelineRunInner class. */ + public PipelineRunInner() { + } + + /** + * Get the innerProperties property: The properties of a pipeline run. + * + * @return the innerProperties value. + */ + private PipelineRunProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning state of a pipeline run. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the request property: The request parameters for a pipeline run. + * + * @return the request value. + */ + public PipelineRunRequest request() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PipelineRunProperties(); + } + this.innerProperties().withRequest(request); + return this; + } + + /** + * Get the response property: The response of a pipeline run. + * + * @return the response value. + */ + public PipelineRunResponse response() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PipelineRunProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunProperties.java new file mode 100644 index 0000000000000..b521d48148043 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) 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.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.JsonProperty; + +/** The properties of a pipeline run. */ +@Fluent +public final class PipelineRunProperties { + /* + * The provisioning state of a pipeline run. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The request parameters for a pipeline run. + */ + @JsonProperty(value = "request") + private PipelineRunRequest request; + + /* + * The response of a pipeline run. + */ + @JsonProperty(value = "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 = "forceUpdateTag") + private String forceUpdateTag; + + /** Creates an instance of PipelineRunProperties class. */ + public PipelineRunProperties() { + } + + /** + * 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 PipelineRunProperties object itself. + */ + public PipelineRunProperties 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 PipelineRunProperties object itself. + */ + public PipelineRunProperties withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * 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..d46d1e800e99a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,120 @@ +// Copyright (c) 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.management.ProxyResource; +import com.azure.core.management.SystemData; +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.JsonProperty; + +/** An object that represents a private endpoint connection for a container registry. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * The properties of a private endpoint connection. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: The properties of a private endpoint connection. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of private endpoint connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..913ea497c00c5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) 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.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.JsonProperty; + +/** The properties of a private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The resource of private endpoint. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + + /** + * 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 PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties 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; + } + + /** + * 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..c09f381d2c418 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A resource that supports private link capabilities. */ +@Fluent +public final class PrivateLinkResourceInner { + /* + * The resource type is private link resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A resource that supports private link capabilities. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /** Creates an instance of PrivateLinkResourceInner class. */ + public PrivateLinkResourceInner() { + } + + /** + * 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 innerProperties property: A resource that supports private link capabilities. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withGroupId(groupId); + return this; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredMembers(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..de0999db6a12d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers") + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + + /** + * 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 PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties 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 PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties 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 PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties 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..2471a9b97223e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryInner.java @@ -0,0 +1,439 @@ +// Copyright (c) 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.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.MetadataSearch; +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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An object that represents a container registry. */ +@Fluent +public final class RegistryInner extends Resource { + /* + * The SKU of the container registry. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * The identity of the container registry. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The properties of the container registry. + */ + @JsonProperty(value = "properties") + private RegistryProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of RegistryInner class. */ + public RegistryInner() { + } + + /** + * 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 innerProperties property: The properties of the container registry. + * + * @return the innerProperties value. + */ + private RegistryProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().loginServer(); + } + + /** + * Get the creationDate property: The creation date of the container registry in ISO8601 format. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value. + */ + public Boolean adminUserEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withAdminUserEnabled(adminUserEnabled); + return this; + } + + /** + * Get the networkRuleSet property: The network rule set for a container registry. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withNetworkRuleSet(networkRuleSet); + return this; + } + + /** + * Get the policies property: The policies for a container registry. + * + * @return the policies value. + */ + public Policies policies() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withPolicies(policies); + return this; + } + + /** + * Get the encryption property: The encryption settings of container registry. + * + * @return the encryption value. + */ + public EncryptionProperty encryption() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withEncryption(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withDataEndpointEnabled(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.innerProperties() == null ? null : this.innerProperties().dataEndpointHostNames(); + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections for a container registry. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withPublicNetworkAccess(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withNetworkRuleBypassOptions(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withZoneRedundancy(zoneRedundancy); + return this; + } + + /** + * Get the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @return the anonymousPullEnabled value. + */ + public Boolean anonymousPullEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withAnonymousPullEnabled(anonymousPullEnabled); + return this; + } + + /** + * Get the metadataSearch property: Determines whether registry artifacts are indexed for metadata search. + * + * @return the metadataSearch value. + */ + public MetadataSearch metadataSearch() { + return this.innerProperties() == null ? null : this.innerProperties().metadataSearch(); + } + + /** + * Set the metadataSearch property: Determines whether registry artifacts are indexed for metadata search. + * + * @param metadataSearch the metadataSearch value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withMetadataSearch(MetadataSearch metadataSearch) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withMetadataSearch(metadataSearch); + 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 (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegistryInner.class); +} 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..8eaaaa1294b66 --- /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.resourcemanager.containerregistry.generated.models.RegistryPassword; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the ListCredentials operation. */ +@Fluent +public final class RegistryListCredentialsResultInner { + /* + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** Creates an instance of RegistryListCredentialsResultInner class. */ + public RegistryListCredentialsResultInner() { + } + + /** + * 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..69f65dcb96495 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryNameStatusInner.java @@ -0,0 +1,104 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; + +/** The result of a request to check the availability of a container registry name. */ +@Fluent +public final class RegistryNameStatusInner { + /* + * The value that indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * If any, the reason that the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * If any, the error message that provides more detail for the reason that the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of RegistryNameStatusInner class. */ + public RegistryNameStatusInner() { + } + + /** + * 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/RegistryProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryProperties.java new file mode 100644 index 0000000000000..b470e696b2117 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.EncryptionProperty; +import com.azure.resourcemanager.containerregistry.generated.models.MetadataSearch; +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.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a container registry. */ +@Fluent +public final class RegistryProperties { + /* + * The URL that can be used to log into the container registry. + */ + @JsonProperty(value = "loginServer", access = JsonProperty.Access.WRITE_ONLY) + private String loginServer; + + /* + * The creation date of the container registry in ISO8601 format. + */ + @JsonProperty(value = "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 = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The status of the container registry at the time the operation was called. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "adminUserEnabled") + private Boolean adminUserEnabled; + + /* + * The network rule set for a container registry. + */ + @JsonProperty(value = "networkRuleSet") + private NetworkRuleSet networkRuleSet; + + /* + * The policies for a container registry. + */ + @JsonProperty(value = "policies") + private Policies policies; + + /* + * The encryption settings of container registry. + */ + @JsonProperty(value = "encryption") + private EncryptionProperty encryption; + + /* + * Enable a single data endpoint per region for serving data. + */ + @JsonProperty(value = "dataEndpointEnabled") + private Boolean dataEndpointEnabled; + + /* + * List of host names that will serve data when dataEndpointEnabled is true. + */ + @JsonProperty(value = "dataEndpointHostNames", access = JsonProperty.Access.WRITE_ONLY) + private List dataEndpointHostNames; + + /* + * List of private endpoint connections for a container registry. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Whether or not public network access is allowed for the container registry. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Whether to allow trusted Azure services to access a network restricted registry. + */ + @JsonProperty(value = "networkRuleBypassOptions") + private NetworkRuleBypassOptions networkRuleBypassOptions; + + /* + * Whether or not zone redundancy is enabled for this container registry + */ + @JsonProperty(value = "zoneRedundancy") + private ZoneRedundancy zoneRedundancy; + + /* + * Enables registry-wide pull from unauthenticated clients. + */ + @JsonProperty(value = "anonymousPullEnabled") + private Boolean anonymousPullEnabled; + + /* + * Determines whether registry artifacts are indexed for metadata search. + */ + @JsonProperty(value = "metadataSearch") + private MetadataSearch metadataSearch; + + /** Creates an instance of RegistryProperties class. */ + public RegistryProperties() { + } + + /** + * 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 RegistryProperties object itself. + */ + public RegistryProperties 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 RegistryProperties object itself. + */ + public RegistryProperties 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 RegistryProperties object itself. + */ + public RegistryProperties 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 RegistryProperties object itself. + */ + public RegistryProperties 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 RegistryProperties object itself. + */ + public RegistryProperties 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 RegistryProperties object itself. + */ + public RegistryProperties 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 RegistryProperties object itself. + */ + public RegistryProperties 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 RegistryProperties object itself. + */ + public RegistryProperties 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 RegistryProperties object itself. + */ + public RegistryProperties withAnonymousPullEnabled(Boolean anonymousPullEnabled) { + this.anonymousPullEnabled = anonymousPullEnabled; + return this; + } + + /** + * Get the metadataSearch property: Determines whether registry artifacts are indexed for metadata search. + * + * @return the metadataSearch value. + */ + public MetadataSearch metadataSearch() { + return this.metadataSearch; + } + + /** + * Set the metadataSearch property: Determines whether registry artifacts are indexed for metadata search. + * + * @param metadataSearch the metadataSearch value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withMetadataSearch(MetadataSearch metadataSearch) { + this.metadataSearch = metadataSearch; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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/RegistryPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..1d5f2e8dcd221 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryPropertiesUpdateParameters.java @@ -0,0 +1,276 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.models.EncryptionProperty; +import com.azure.resourcemanager.containerregistry.generated.models.MetadataSearch; +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.PublicNetworkAccess; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating the properties of a container registry. */ +@Fluent +public final class RegistryPropertiesUpdateParameters { + /* + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "adminUserEnabled") + private Boolean adminUserEnabled; + + /* + * The network rule set for a container registry. + */ + @JsonProperty(value = "networkRuleSet") + private NetworkRuleSet networkRuleSet; + + /* + * The policies for a container registry. + */ + @JsonProperty(value = "policies") + private Policies policies; + + /* + * The encryption settings of container registry. + */ + @JsonProperty(value = "encryption") + private EncryptionProperty encryption; + + /* + * Enable a single data endpoint per region for serving data. + */ + @JsonProperty(value = "dataEndpointEnabled") + private Boolean dataEndpointEnabled; + + /* + * Whether or not public network access is allowed for the container registry. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Whether to allow trusted Azure services to access a network restricted registry. + */ + @JsonProperty(value = "networkRuleBypassOptions") + private NetworkRuleBypassOptions networkRuleBypassOptions; + + /* + * Enables registry-wide pull from unauthenticated clients. + */ + @JsonProperty(value = "anonymousPullEnabled") + private Boolean anonymousPullEnabled; + + /* + * Determines whether registry artifacts are indexed for metadata search. + */ + @JsonProperty(value = "metadataSearch") + private MetadataSearch metadataSearch; + + /** Creates an instance of RegistryPropertiesUpdateParameters class. */ + public RegistryPropertiesUpdateParameters() { + } + + /** + * 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 RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters 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 RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters 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 RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters 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 RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters 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 RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters 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 RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters 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 RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters 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 RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters withAnonymousPullEnabled(Boolean anonymousPullEnabled) { + this.anonymousPullEnabled = anonymousPullEnabled; + return this; + } + + /** + * Get the metadataSearch property: Determines whether registry artifacts are indexed for metadata search. + * + * @return the metadataSearch value. + */ + public MetadataSearch metadataSearch() { + return this.metadataSearch; + } + + /** + * Set the metadataSearch property: Determines whether registry artifacts are indexed for metadata search. + * + * @param metadataSearch the metadataSearch value to set. + * @return the RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters withMetadataSearch(MetadataSearch metadataSearch) { + this.metadataSearch = metadataSearch; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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/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..c8e3b476001cf --- /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.resourcemanager.containerregistry.generated.models.RegistryUsage; +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 { + /* + * The list of container registry quota usages. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of RegistryUsageListResultInner class. */ + public RegistryUsageListResultInner() { + } + + /** + * 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..167d3410b74dc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationInner.java @@ -0,0 +1,148 @@ +// Copyright (c) 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.management.Resource; +import com.azure.core.management.SystemData; +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.JsonProperty; +import java.util.Map; + +/** An object that represents a replication for a container registry. */ +@Fluent +public final class ReplicationInner extends Resource { + /* + * The properties of the replication. + */ + @JsonProperty(value = "properties") + private ReplicationProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ReplicationInner class. */ + public ReplicationInner() { + } + + /** + * Get the innerProperties property: The properties of the replication. + * + * @return the innerProperties value. + */ + private ReplicationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ReplicationProperties(); + } + this.innerProperties().withRegionEndpointEnabled(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ReplicationProperties(); + } + this.innerProperties().withZoneRedundancy(zoneRedundancy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationProperties.java new file mode 100644 index 0000000000000..b81f4722b3d8c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) 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.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.JsonProperty; + +/** The properties of a replication. */ +@Fluent +public final class ReplicationProperties { + /* + * The provisioning state of the replication at the time the operation was called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The status of the replication at the time the operation was called. + */ + @JsonProperty(value = "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 = "regionEndpointEnabled") + private Boolean regionEndpointEnabled; + + /* + * Whether or not zone redundancy is enabled for this container registry replication + */ + @JsonProperty(value = "zoneRedundancy") + private ZoneRedundancy zoneRedundancy; + + /** Creates an instance of ReplicationProperties class. */ + public ReplicationProperties() { + } + + /** + * 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 ReplicationProperties object itself. + */ + public ReplicationProperties 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 ReplicationProperties object itself. + */ + public ReplicationProperties withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + this.zoneRedundancy = zoneRedundancy; + 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/ReplicationUpdateParametersProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationUpdateParametersProperties.java new file mode 100644 index 0000000000000..66335debe8f88 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationUpdateParametersProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** The ReplicationUpdateParametersProperties model. */ +@Fluent +public final class ReplicationUpdateParametersProperties { + /* + * 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 = "regionEndpointEnabled") + private Boolean regionEndpointEnabled; + + /** Creates an instance of ReplicationUpdateParametersProperties class. */ + public ReplicationUpdateParametersProperties() { + } + + /** + * 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 ReplicationUpdateParametersProperties object itself. + */ + public ReplicationUpdateParametersProperties 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/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..d3d358042be9c --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The result of get log link operation. */ +@Fluent +public final class RunGetLogResultInner { + /* + * 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; + + /** Creates an instance of RunGetLogResultInner class. */ + public RunGetLogResultInner() { + } + + /** + * 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..e8a6d28ab6756 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunInner.java @@ -0,0 +1,554 @@ +// Copyright (c) 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.management.ProxyResource; +import com.azure.core.management.SystemData; +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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Run resource properties. */ +@Fluent +public final class RunInner extends ProxyResource { + /* + * The properties of a run. + */ + @JsonProperty(value = "properties") + private RunProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of RunInner class. */ + public RunInner() { + } + + /** + * Get the innerProperties property: The properties of a run. + * + * @return the innerProperties value. + */ + private RunProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the runId property: The unique identifier for the run. + * + * @return the runId value. + */ + public String runId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withRunId(runId); + return this; + } + + /** + * Get the status property: The current status of the run. + * + * @return the status value. + */ + public RunStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the lastUpdatedTime property: The last updated time for the run. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withLastUpdatedTime(lastUpdatedTime); + return this; + } + + /** + * Get the runType property: The type of run. + * + * @return the runType value. + */ + public RunType runType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withRunType(runType); + return this; + } + + /** + * Get the agentPoolName property: The dedicated agent pool for the run. + * + * @return the agentPoolName value. + */ + public String agentPoolName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withAgentPoolName(agentPoolName); + return this; + } + + /** + * Get the createTime property: The time the run was scheduled. + * + * @return the createTime value. + */ + public OffsetDateTime createTime() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withCreateTime(createTime); + return this; + } + + /** + * Get the startTime property: The time the run started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withStartTime(startTime); + return this; + } + + /** + * Get the finishTime property: The time the run finished. + * + * @return the finishTime value. + */ + public OffsetDateTime finishTime() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withFinishTime(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withOutputImages(outputImages); + return this; + } + + /** + * Get the task property: The task against which run was scheduled. + * + * @return the task value. + */ + public String task() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withTask(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withImageUpdateTrigger(imageUpdateTrigger); + return this; + } + + /** + * Get the sourceTrigger property: The source trigger that caused the run. + * + * @return the sourceTrigger value. + */ + public SourceTriggerDescriptor sourceTrigger() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withSourceTrigger(sourceTrigger); + return this; + } + + /** + * Get the timerTrigger property: The timer trigger that caused the run. + * + * @return the timerTrigger value. + */ + public TimerTriggerDescriptor timerTrigger() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withTimerTrigger(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withPlatform(platform); + return this; + } + + /** + * Get the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + public AgentProperties agentConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withAgentConfiguration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withSourceRegistryAuth(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withCustomRegistries(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.innerProperties() == null ? null : this.innerProperties().runErrorMessage(); + } + + /** + * Get the updateTriggerToken property: The update trigger token passed for the Run. + * + * @return the updateTriggerToken value. + */ + public String updateTriggerToken() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withUpdateTriggerToken(updateTriggerToken); + return this; + } + + /** + * Get the logArtifact property: The image description for the log artifact. + * + * @return the logArtifact value. + */ + public ImageDescriptor logArtifact() { + return this.innerProperties() == null ? null : this.innerProperties().logArtifact(); + } + + /** + * Get the provisioningState property: The provisioning state of a run. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withProvisioningState(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RunProperties(); + } + this.innerProperties().withIsArchiveEnabled(isArchiveEnabled); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunProperties.java new file mode 100644 index 0000000000000..8fa7d0785eb34 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RunProperties.java @@ -0,0 +1,613 @@ +// Copyright (c) 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.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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties for a run. */ +@Fluent +public final class RunProperties { + /* + * The unique identifier for the run. + */ + @JsonProperty(value = "runId") + private String runId; + + /* + * The current status of the run. + */ + @JsonProperty(value = "status") + private RunStatus status; + + /* + * The last updated time for the run. + */ + @JsonProperty(value = "lastUpdatedTime") + private OffsetDateTime lastUpdatedTime; + + /* + * The type of run. + */ + @JsonProperty(value = "runType") + private RunType runType; + + /* + * The dedicated agent pool for the run. + */ + @JsonProperty(value = "agentPoolName") + private String agentPoolName; + + /* + * The time the run was scheduled. + */ + @JsonProperty(value = "createTime") + private OffsetDateTime createTime; + + /* + * The time the run started. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The time the run finished. + */ + @JsonProperty(value = "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 = "outputImages") + private List outputImages; + + /* + * The task against which run was scheduled. + */ + @JsonProperty(value = "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 = "imageUpdateTrigger") + private ImageUpdateTrigger imageUpdateTrigger; + + /* + * The source trigger that caused the run. + */ + @JsonProperty(value = "sourceTrigger") + private SourceTriggerDescriptor sourceTrigger; + + /* + * The timer trigger that caused the run. + */ + @JsonProperty(value = "timerTrigger") + private TimerTriggerDescriptor timerTrigger; + + /* + * The platform properties against which the run will happen. + */ + @JsonProperty(value = "platform") + private PlatformProperties platform; + + /* + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /* + * The scope of the credentials that were used to login to the source registry during this run. + */ + @JsonProperty(value = "sourceRegistryAuth") + private String sourceRegistryAuth; + + /* + * The list of custom registries that were logged in during this run. + */ + @JsonProperty(value = "customRegistries") + private List customRegistries; + + /* + * The error message received from backend systems after the run is scheduled. + */ + @JsonProperty(value = "runErrorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String runErrorMessage; + + /* + * The update trigger token passed for the Run. + */ + @JsonProperty(value = "updateTriggerToken") + private String updateTriggerToken; + + /* + * The image description for the log artifact. + */ + @JsonProperty(value = "logArtifact", access = JsonProperty.Access.WRITE_ONLY) + private ImageDescriptor logArtifact; + + /* + * The provisioning state of a run. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /* + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** Creates an instance of RunProperties class. */ + public RunProperties() { + } + + /** + * 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties 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 RunProperties object itself. + */ + public RunProperties withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * 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..14c1b01cbef02 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapInner.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.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +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. */ +@Fluent +public final class ScopeMapInner extends ProxyResource { + /* + * The properties of the scope map. + */ + @JsonProperty(value = "properties") + private ScopeMapProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ScopeMapInner class. */ + public ScopeMapInner() { + } + + /** + * Get the innerProperties property: The properties of the scope map. + * + * @return the innerProperties value. + */ + private ScopeMapProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the description property: The user friendly description of the scope map. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeMapProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the type property: The type of the scope map. E.g. BuildIn scope map. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Get the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeMapProperties(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapProperties.java new file mode 100644 index 0000000000000..b427c59606fdc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a scope map. */ +@Fluent +public final class ScopeMapProperties { + /* + * The user friendly description of the scope map. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The type of the scope map. E.g. BuildIn scope map. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The creation date of scope map. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "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 = "actions", required = true) + private List actions; + + /** Creates an instance of ScopeMapProperties class. */ + public ScopeMapProperties() { + } + + /** + * 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 ScopeMapProperties object itself. + */ + public ScopeMapProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the type property: The type of the scope map. E.g. BuildIn scope map. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * 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 ScopeMapProperties object itself. + */ + public ScopeMapProperties withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property actions in model ScopeMapProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScopeMapProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..1543cab95bdfb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapPropertiesUpdateParameters.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The update parameters for scope map properties. */ +@Fluent +public final class ScopeMapPropertiesUpdateParameters { + /* + * The user friendly description of the scope map. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The list of scope permissions for registry artifacts. + * E.g. repositories/repository-name/pull, + * repositories/repository-name/delete + */ + @JsonProperty(value = "actions") + private List actions; + + /** Creates an instance of ScopeMapPropertiesUpdateParameters class. */ + public ScopeMapPropertiesUpdateParameters() { + } + + /** + * 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 ScopeMapPropertiesUpdateParameters object itself. + */ + public ScopeMapPropertiesUpdateParameters 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 ScopeMapPropertiesUpdateParameters object itself. + */ + public ScopeMapPropertiesUpdateParameters 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/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..98e850be02eca --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/SourceUploadDefinitionInner.java @@ -0,0 +1,78 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a response to source upload request. */ +@Fluent +public final class SourceUploadDefinitionInner { + /* + * The URL where the client can upload the source. + */ + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + /* + * The relative path to the source. This is used to submit the subsequent queue build request. + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /** Creates an instance of SourceUploadDefinitionInner class. */ + public SourceUploadDefinitionInner() { + } + + /** + * 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..c7c651341b2d1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskInner.java @@ -0,0 +1,369 @@ +// Copyright (c) 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.management.Resource; +import com.azure.core.management.SystemData; +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.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. + */ +@Fluent +public final class TaskInner extends Resource { + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The properties of a task. + */ + @JsonProperty(value = "properties") + private TaskProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of TaskInner class. */ + public TaskInner() { + } + + /** + * 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 innerProperties property: The properties of a task. + * + * @return the innerProperties value. + */ + private TaskProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the provisioningState property: The provisioning state of the task. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the creationDate property: The creation date of task. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); + } + + /** + * Get the status property: The current status of task. + * + * @return the status value. + */ + public TaskStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskProperties(); + } + this.innerProperties().withStatus(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskProperties(); + } + this.innerProperties().withPlatform(platform); + return this; + } + + /** + * Get the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + public AgentProperties agentConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskProperties(); + } + this.innerProperties().withAgentConfiguration(agentConfiguration); + return this; + } + + /** + * Get the agentPoolName property: The dedicated agent pool for the task. + * + * @return the agentPoolName value. + */ + public String agentPoolName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskProperties(); + } + this.innerProperties().withAgentPoolName(agentPoolName); + return this; + } + + /** + * Get the timeout property: Run timeout in seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskProperties(); + } + this.innerProperties().withTimeout(timeout); + return this; + } + + /** + * Get the step property: The properties of a task step. + * + * @return the step value. + */ + public TaskStepProperties step() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskProperties(); + } + this.innerProperties().withStep(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskProperties(); + } + this.innerProperties().withTrigger(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskProperties(); + } + this.innerProperties().withCredentials(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskProperties(); + } + this.innerProperties().withLogTemplate(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskProperties(); + } + this.innerProperties().withIsSystemTask(isSystemTask); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskProperties.java new file mode 100644 index 0000000000000..75cae9cc69fb5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskProperties.java @@ -0,0 +1,343 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +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.JsonProperty; +import java.time.OffsetDateTime; + +/** The properties of a task. */ +@Fluent +public final class TaskProperties { + /* + * The provisioning state of the task. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The creation date of task. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * The current status of task. + */ + @JsonProperty(value = "status") + private TaskStatus status; + + /* + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform") + private PlatformProperties platform; + + /* + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /* + * The dedicated agent pool for the task. + */ + @JsonProperty(value = "agentPoolName") + private String agentPoolName; + + /* + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /* + * The properties of a task step. + */ + @JsonProperty(value = "step") + private TaskStepProperties step; + + /* + * The properties that describe all triggers for the task. + */ + @JsonProperty(value = "trigger") + private TriggerProperties trigger; + + /* + * The properties that describes a set of credentials that will be used when this run is invoked. + */ + @JsonProperty(value = "credentials") + private Credentials credentials; + + /* + * The template that describes the repository and tag information for run log artifact. + */ + @JsonProperty(value = "logTemplate") + private String logTemplate; + + /* + * The value of this property indicates whether the task resource is system task or not. + */ + @JsonProperty(value = "isSystemTask") + private Boolean isSystemTask; + + /** Creates an instance of TaskProperties class. */ + public TaskProperties() { + } + + /** + * 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 TaskProperties object itself. + */ + public TaskProperties 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 TaskProperties object itself. + */ + public TaskProperties 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 TaskProperties object itself. + */ + public TaskProperties 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 TaskProperties object itself. + */ + public TaskProperties 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 TaskProperties object itself. + */ + public TaskProperties 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 TaskProperties object itself. + */ + public TaskProperties 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 TaskProperties object itself. + */ + public TaskProperties 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 TaskProperties object itself. + */ + public TaskProperties 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 TaskProperties object itself. + */ + public TaskProperties 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 TaskProperties object itself. + */ + public TaskProperties withIsSystemTask(Boolean isSystemTask) { + this.isSystemTask = isSystemTask; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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/TaskPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..8064d878ec925 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskPropertiesUpdateParameters.java @@ -0,0 +1,283 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStatus; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStepUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.TriggerUpdateParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties for updating a task. */ +@Fluent +public final class TaskPropertiesUpdateParameters { + /* + * The current status of task. + */ + @JsonProperty(value = "status") + private TaskStatus status; + + /* + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform") + private PlatformUpdateParameters platform; + + /* + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /* + * The dedicated agent pool for the task. + */ + @JsonProperty(value = "agentPoolName") + private String agentPoolName; + + /* + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /* + * The properties for updating a task step. + */ + @JsonProperty(value = "step") + private TaskStepUpdateParameters step; + + /* + * The properties for updating trigger properties. + */ + @JsonProperty(value = "trigger") + private TriggerUpdateParameters trigger; + + /* + * The parameters that describes a set of credentials that will be used when this run is invoked. + */ + @JsonProperty(value = "credentials") + private Credentials credentials; + + /* + * The template that describes the repository and tag information for run log artifact. + */ + @JsonProperty(value = "logTemplate") + private String logTemplate; + + /** Creates an instance of TaskPropertiesUpdateParameters class. */ + public TaskPropertiesUpdateParameters() { + } + + /** + * 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 TaskPropertiesUpdateParameters object itself. + */ + public TaskPropertiesUpdateParameters 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 TaskPropertiesUpdateParameters object itself. + */ + public TaskPropertiesUpdateParameters 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 TaskPropertiesUpdateParameters object itself. + */ + public TaskPropertiesUpdateParameters 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 TaskPropertiesUpdateParameters object itself. + */ + public TaskPropertiesUpdateParameters 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 TaskPropertiesUpdateParameters object itself. + */ + public TaskPropertiesUpdateParameters 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 TaskPropertiesUpdateParameters object itself. + */ + public TaskPropertiesUpdateParameters 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 TaskPropertiesUpdateParameters object itself. + */ + public TaskPropertiesUpdateParameters 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 TaskPropertiesUpdateParameters object itself. + */ + public TaskPropertiesUpdateParameters 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 TaskPropertiesUpdateParameters object itself. + */ + public TaskPropertiesUpdateParameters withLogTemplate(String logTemplate) { + this.logTemplate = logTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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..67d744b90cda8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +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.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. + */ +@Fluent +public final class TaskRunInner extends ProxyResource { + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The properties associated with the task run, i.e., request and result of the run + */ + @JsonProperty(value = "properties") + private TaskRunPropertiesInner innerProperties; + + /* + * The location of the resource + */ + @JsonProperty(value = "location") + private String location; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of TaskRunInner class. */ + public TaskRunInner() { + } + + /** + * 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 innerProperties property: The properties associated with the task run, i.e., request and result of the + * run. + * + * @return the innerProperties value. + */ + private TaskRunPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning state of this task run. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the runRequest property: The request (parameters) for the run. + * + * @return the runRequest value. + */ + public RunRequest runRequest() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskRunPropertiesInner(); + } + this.innerProperties().withRunRequest(runRequest); + return this; + } + + /** + * Get the runResult property: The result of this task run. + * + * @return the runResult value. + */ + public RunInner runResult() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskRunPropertiesInner(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunPropertiesInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunPropertiesInner.java new file mode 100644 index 0000000000000..e6f453cabd1c3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunPropertiesInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.RunRequest; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of task run. */ +@Fluent +public final class TaskRunPropertiesInner { + /* + * The provisioning state of this task run + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The request (parameters) for the run + */ + @JsonProperty(value = "runRequest") + private RunRequest runRequest; + + /* + * The result of this task run + */ + @JsonProperty(value = "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 = "forceUpdateTag") + private String forceUpdateTag; + + /** Creates an instance of TaskRunPropertiesInner class. */ + public TaskRunPropertiesInner() { + } + + /** + * 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 TaskRunPropertiesInner object itself. + */ + public TaskRunPropertiesInner 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 TaskRunPropertiesInner object itself. + */ + public TaskRunPropertiesInner withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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/TaskRunPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..4c9372d43dcbb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TaskRunPropertiesUpdateParameters.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.resourcemanager.containerregistry.generated.models.RunRequest; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a task run update parameters. */ +@Fluent +public final class TaskRunPropertiesUpdateParameters { + /* + * The request (parameters) for the new run + */ + @JsonProperty(value = "runRequest") + private RunRequest runRequest; + + /* + * How the run should be forced to rerun even if the run request configuration has not changed + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /** Creates an instance of TaskRunPropertiesUpdateParameters class. */ + public TaskRunPropertiesUpdateParameters() { + } + + /** + * 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 TaskRunPropertiesUpdateParameters object itself. + */ + public TaskRunPropertiesUpdateParameters 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 TaskRunPropertiesUpdateParameters object itself. + */ + public TaskRunPropertiesUpdateParameters withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (runRequest() != null) { + runRequest().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..433a3208d3c32 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenInner.java @@ -0,0 +1,150 @@ +// Copyright (c) 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.management.ProxyResource; +import com.azure.core.management.SystemData; +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.JsonProperty; +import java.time.OffsetDateTime; + +/** An object that represents a token for a container registry. */ +@Fluent +public final class TokenInner extends ProxyResource { + /* + * The properties of the token. + */ + @JsonProperty(value = "properties") + private TokenProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of TokenInner class. */ + public TokenInner() { + } + + /** + * Get the innerProperties property: The properties of the token. + * + * @return the innerProperties value. + */ + private TokenProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenProperties(); + } + this.innerProperties().withScopeMapId(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenProperties(); + } + this.innerProperties().withCredentials(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenProperties.java new file mode 100644 index 0000000000000..f92b3e75a676f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenProperties.java @@ -0,0 +1,139 @@ +// Copyright (c) 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.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.JsonProperty; +import java.time.OffsetDateTime; + +/** The properties of a token. */ +@Fluent +public final class TokenProperties { + /* + * The creation date of scope map. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "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 = "scopeMapId") + private String scopeMapId; + + /* + * The credentials that can be used for authenticating the token. + */ + @JsonProperty(value = "credentials") + private TokenCredentialsProperties credentials; + + /* + * The status of the token example enabled or disabled. + */ + @JsonProperty(value = "status") + private TokenStatus status; + + /** Creates an instance of TokenProperties class. */ + public TokenProperties() { + } + + /** + * 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 TokenProperties object itself. + */ + public TokenProperties 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 TokenProperties object itself. + */ + public TokenProperties 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 TokenProperties object itself. + */ + public TokenProperties withStatus(TokenStatus status) { + this.status = status; + 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/fluent/models/TokenUpdateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenUpdateProperties.java new file mode 100644 index 0000000000000..6bbe82e7f27c2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenUpdateProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating token properties. */ +@Fluent +public final class TokenUpdateProperties { + /* + * The resource ID of the scope map to which the token will be associated with. + */ + @JsonProperty(value = "scopeMapId") + private String scopeMapId; + + /* + * The status of the token example enabled or disabled. + */ + @JsonProperty(value = "status") + private TokenStatus status; + + /* + * The credentials that can be used for authenticating the token. + */ + @JsonProperty(value = "credentials") + private TokenCredentialsProperties credentials; + + /** Creates an instance of TokenUpdateProperties class. */ + public TokenUpdateProperties() { + } + + /** + * 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 TokenUpdateProperties object itself. + */ + public TokenUpdateProperties 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 TokenUpdateProperties object itself. + */ + public TokenUpdateProperties 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 TokenUpdateProperties object itself. + */ + public TokenUpdateProperties 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/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..e1b8da4e06056 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +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.JsonProperty; +import java.util.List; +import java.util.Map; + +/** An object that represents a webhook for a container registry. */ +@Fluent +public final class WebhookInner extends Resource { + /* + * The properties of the webhook. + */ + @JsonProperty(value = "properties") + private WebhookProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of WebhookInner class. */ + public WebhookInner() { + } + + /** + * Get the innerProperties property: The properties of the webhook. + * + * @return the innerProperties value. + */ + private WebhookProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookProperties(); + } + this.innerProperties().withStatus(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookProperties(); + } + this.innerProperties().withScope(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookProperties(); + } + this.innerProperties().withActions(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookProperties.java new file mode 100644 index 0000000000000..b7fd388339267 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookProperties.java @@ -0,0 +1,135 @@ +// Copyright (c) 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.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a webhook. */ +@Fluent +public final class WebhookProperties { + /* + * The status of the webhook at the time the operation was called. + */ + @JsonProperty(value = "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 = "scope") + private String scope; + + /* + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "actions", required = true) + private List actions; + + /* + * The provisioning state of the webhook at the time the operation was called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of WebhookProperties class. */ + public WebhookProperties() { + } + + /** + * 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 WebhookProperties object itself. + */ + public WebhookProperties 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 WebhookProperties object itself. + */ + public WebhookProperties 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 WebhookProperties object itself. + */ + public WebhookProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property actions in model WebhookProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebhookProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesCreateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesCreateParameters.java new file mode 100644 index 0000000000000..76ef89d789bb9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesCreateParameters.java @@ -0,0 +1,181 @@ +// Copyright (c) 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.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters for creating the properties of a webhook. */ +@Fluent +public final class WebhookPropertiesCreateParameters { + /* + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "serviceUri") + private String serviceUri; + + /* + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "customHeaders") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customHeaders; + + /* + * The status of the webhook at the time the operation was called. + */ + @JsonProperty(value = "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 = "scope") + private String scope; + + /* + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "actions", required = true) + private List actions; + + /** Creates an instance of WebhookPropertiesCreateParameters class. */ + public WebhookPropertiesCreateParameters() { + } + + /** + * 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 WebhookPropertiesCreateParameters object itself. + */ + public WebhookPropertiesCreateParameters 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 WebhookPropertiesCreateParameters object itself. + */ + public WebhookPropertiesCreateParameters 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 WebhookPropertiesCreateParameters object itself. + */ + public WebhookPropertiesCreateParameters 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 WebhookPropertiesCreateParameters object itself. + */ + public WebhookPropertiesCreateParameters 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 WebhookPropertiesCreateParameters object itself. + */ + public WebhookPropertiesCreateParameters withActions(List actions) { + this.actions = actions; + 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 WebhookPropertiesCreateParameters")); + } + if (actions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property actions in model WebhookPropertiesCreateParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebhookPropertiesCreateParameters.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..4b8e7cb669e5d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesUpdateParameters.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters for updating the properties of a webhook. */ +@Fluent +public final class WebhookPropertiesUpdateParameters { + /* + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "serviceUri") + private String serviceUri; + + /* + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "customHeaders") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customHeaders; + + /* + * The status of the webhook at the time the operation was called. + */ + @JsonProperty(value = "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 = "scope") + private String scope; + + /* + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "actions") + private List actions; + + /** Creates an instance of WebhookPropertiesUpdateParameters class. */ + public WebhookPropertiesUpdateParameters() { + } + + /** + * 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 WebhookPropertiesUpdateParameters object itself. + */ + public WebhookPropertiesUpdateParameters 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 WebhookPropertiesUpdateParameters object itself. + */ + public WebhookPropertiesUpdateParameters 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 WebhookPropertiesUpdateParameters object itself. + */ + public WebhookPropertiesUpdateParameters 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 WebhookPropertiesUpdateParameters object itself. + */ + public WebhookPropertiesUpdateParameters 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 WebhookPropertiesUpdateParameters object itself. + */ + public WebhookPropertiesUpdateParameters 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/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..b8f01a52ce8bf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolImpl.java @@ -0,0 +1,244 @@ +// Copyright (c) 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 Response getQueueStatusWithResponse(Context context) { + return serviceManager + .agentPools() + .getQueueStatusWithResponse(resourceGroupName, registryName, agentPoolName, context); + } + + public AgentPoolQueueStatus getQueueStatus() { + return serviceManager.agentPools().getQueueStatus(resourceGroupName, registryName, agentPoolName); + } + + 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..434c537b9c654 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolsClientImpl.java @@ -0,0 +1,1636 @@ +// Copyright (c) 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.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 { + /** 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String agentPoolName) { + return getWithResponseAsync(resourceGroupName, registryName, agentPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, agentPoolName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getWithResponse(resourceGroupName, registryName, agentPoolName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentPoolInner> beginCreate( + String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + return this.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 {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentPoolInner> beginCreate( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolInner agentPool, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String agentPoolName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentPoolInner> beginUpdate( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters) { + return this.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 {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentPoolInner> beginUpdate( + String resourceGroupName, + String registryName, + String agentPoolName, + AgentPoolUpdateParameters updateParameters, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getQueueStatusAsync( + String resourceGroupName, String registryName, String agentPoolName) { + return getQueueStatusWithResponseAsync(resourceGroupName, registryName, agentPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getQueueStatusWithResponse( + String resourceGroupName, String registryName, String agentPoolName, Context context) { + return getQueueStatusWithResponseAsync(resourceGroupName, registryName, agentPoolName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getQueueStatusWithResponse(resourceGroupName, registryName, agentPoolName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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..a3082ac6a61a6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/AgentPoolsImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) 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; + +public final class AgentPoolsImpl implements AgentPools { + private static 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 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 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 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 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 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 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/ArchiveImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveImpl.java new file mode 100644 index 0000000000000..bd01a92753888 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) 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.ArchiveInner; +import com.azure.resourcemanager.containerregistry.generated.models.Archive; +import com.azure.resourcemanager.containerregistry.generated.models.ArchivePackageSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ArchiveUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; + +public final class ArchiveImpl implements Archive, Archive.Definition, Archive.Update { + private ArchiveInner 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ArchivePackageSourceProperties packageSource() { + return this.innerModel().packageSource(); + } + + public String publishedVersion() { + return this.innerModel().publishedVersion(); + } + + public String repositoryEndpointPrefix() { + return this.innerModel().repositoryEndpointPrefix(); + } + + public String repositoryEndpoint() { + return this.innerModel().repositoryEndpoint(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ArchiveInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String packageType; + + private String archiveName; + + private ArchiveUpdateParameters updateArchiveUpdateParameters; + + public ArchiveImpl withExistingPackage(String resourceGroupName, String registryName, String packageType) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + this.packageType = packageType; + return this; + } + + public Archive create() { + this.innerObject = + serviceManager + .serviceClient() + .getArchives() + .create(resourceGroupName, registryName, packageType, archiveName, this.innerModel(), Context.NONE); + return this; + } + + public Archive create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArchives() + .create(resourceGroupName, registryName, packageType, archiveName, this.innerModel(), context); + return this; + } + + ArchiveImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ArchiveInner(); + this.serviceManager = serviceManager; + this.archiveName = name; + } + + public ArchiveImpl update() { + this.updateArchiveUpdateParameters = new ArchiveUpdateParameters(); + return this; + } + + public Archive apply() { + this.innerObject = + serviceManager + .serviceClient() + .getArchives() + .updateWithResponse( + resourceGroupName, + registryName, + packageType, + archiveName, + updateArchiveUpdateParameters, + Context.NONE) + .getValue(); + return this; + } + + public Archive apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArchives() + .updateWithResponse( + resourceGroupName, registryName, packageType, archiveName, updateArchiveUpdateParameters, context) + .getValue(); + return this; + } + + ArchiveImpl( + ArchiveInner 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.packageType = Utils.getValueFromIdByName(innerObject.id(), "packages"); + this.archiveName = Utils.getValueFromIdByName(innerObject.id(), "archives"); + } + + public Archive refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getArchives() + .getWithResponse(resourceGroupName, registryName, packageType, archiveName, Context.NONE) + .getValue(); + return this; + } + + public Archive refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArchives() + .getWithResponse(resourceGroupName, registryName, packageType, archiveName, context) + .getValue(); + return this; + } + + public ArchiveImpl withPackageSource(ArchivePackageSourceProperties packageSource) { + this.innerModel().withPackageSource(packageSource); + return this; + } + + public ArchiveImpl withPublishedVersion(String publishedVersion) { + if (isInCreateMode()) { + this.innerModel().withPublishedVersion(publishedVersion); + return this; + } else { + this.updateArchiveUpdateParameters.withPublishedVersion(publishedVersion); + return this; + } + } + + public ArchiveImpl withRepositoryEndpointPrefix(String repositoryEndpointPrefix) { + this.innerModel().withRepositoryEndpointPrefix(repositoryEndpointPrefix); + 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/ArchiveVersionImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveVersionImpl.java new file mode 100644 index 0000000000000..5646130f69c46 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveVersionImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ArchiveVersionInner; +import com.azure.resourcemanager.containerregistry.generated.models.ArchiveVersion; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; + +public final class ArchiveVersionImpl implements ArchiveVersion { + private ArchiveVersionInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + ArchiveVersionImpl( + ArchiveVersionInner 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String archiveVersionErrorMessage() { + return this.innerModel().archiveVersionErrorMessage(); + } + + public ArchiveVersionInner 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/ArchiveVersionsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveVersionsClientImpl.java new file mode 100644 index 0000000000000..95105c539b9f1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveVersionsClientImpl.java @@ -0,0 +1,1359 @@ +// Copyright (c) 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.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ArchiveVersionsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ArchiveVersionInner; +import com.azure.resourcemanager.containerregistry.generated.models.ArchiveVersionListResult; +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 ArchiveVersionsClient. */ +public final class ArchiveVersionsClientImpl implements ArchiveVersionsClient { + /** The proxy service used to perform REST calls. */ + private final ArchiveVersionsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ArchiveVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ArchiveVersionsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ArchiveVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientArchiveVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + public interface ArchiveVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions") + @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, + @PathParam("packageType") String packageType, + @PathParam("archiveName") String archiveName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}") + @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("packageType") String packageType, + @PathParam("archiveName") String archiveName, + @PathParam("archiveVersionName") String archiveVersionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}") + @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("packageType") String packageType, + @PathParam("archiveName") String archiveName, + @PathParam("archiveVersionName") String archiveVersionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}") + @ExpectedResponses({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("packageType") String packageType, + @PathParam("archiveName") String archiveName, + @PathParam("archiveVersionName") String archiveVersionName, + @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 archive versions for the specified container registry, repository type and archive name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String packageType, String archiveName) { + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + 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 archive versions for the specified container registry, repository type and archive name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String packageType, String archiveName, 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all archive versions for the specified container registry, repository type and archive name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String packageType, String archiveName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, packageType, archiveName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all archive versions for the specified container registry, repository type and archive name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, packageType, archiveName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all archive versions for the specified container registry, repository type and archive name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String packageType, String archiveName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, packageType, archiveName)); + } + + /** + * Lists all archive versions for the specified container registry, repository type and archive name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, packageType, archiveName, context)); + } + + /** + * Gets the properties of the archive version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archive version along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + if (archiveVersionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter archiveVersionName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + archiveVersionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the archive version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archive version along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + if (archiveVersionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter archiveVersionName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + archiveVersionName, + accept, + context); + } + + /** + * Gets the properties of the archive version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archive version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + return getWithResponseAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the archive version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archive version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + return getWithResponseAsync( + resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context) + .block(); + } + + /** + * Gets the properties of the archive version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archive version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArchiveVersionInner get( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + return getWithResponse( + resourceGroupName, registryName, packageType, archiveName, archiveVersionName, Context.NONE) + .getValue(); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + if (archiveVersionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter archiveVersionName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + archiveVersionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + if (archiveVersionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter archiveVersionName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + archiveVersionName, + accept, + context); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArchiveVersionInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ArchiveVersionInner.class, + ArchiveVersionInner.class, + this.client.getContext()); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArchiveVersionInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ArchiveVersionInner.class, ArchiveVersionInner.class, context); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArchiveVersionInner> beginCreate( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + return this + .beginCreateAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName) + .getSyncPoller(); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArchiveVersionInner> beginCreate( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + return this + .beginCreateAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context) + .getSyncPoller(); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + return beginCreateAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ArchiveVersionInner create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + return createAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName).block(); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ArchiveVersionInner create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + return createAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context) + .block(); + } + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + if (archiveVersionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter archiveVersionName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + archiveVersionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + if (archiveVersionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter archiveVersionName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + archiveVersionName, + accept, + context); + } + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + return this + .beginDeleteAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName) + .getSyncPoller(); + } + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + return this + .beginDeleteAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context) + .getSyncPoller(); + } + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + return beginDeleteAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + return beginDeleteAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 packageType, + String archiveName, + String archiveVersionName) { + deleteAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName).block(); + } + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 packageType, + String archiveName, + String archiveVersionName, + Context context) { + deleteAsync(resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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/ArchiveVersionsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveVersionsImpl.java new file mode 100644 index 0000000000000..9afaa0be2fffa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchiveVersionsImpl.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.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.ArchiveVersionsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ArchiveVersionInner; +import com.azure.resourcemanager.containerregistry.generated.models.ArchiveVersion; +import com.azure.resourcemanager.containerregistry.generated.models.ArchiveVersions; + +public final class ArchiveVersionsImpl implements ArchiveVersions { + private static final ClientLogger LOGGER = new ClientLogger(ArchiveVersionsImpl.class); + + private final ArchiveVersionsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ArchiveVersionsImpl( + ArchiveVersionsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String registryName, String packageType, String archiveName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, packageType, archiveName); + return Utils.mapPage(inner, inner1 -> new ArchiveVersionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, packageType, archiveName, context); + return Utils.mapPage(inner, inner1 -> new ArchiveVersionImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ArchiveVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArchiveVersion get( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + ArchiveVersionInner inner = + this.serviceClient().get(resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + if (inner != null) { + return new ArchiveVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArchiveVersion create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + ArchiveVersionInner inner = + this.serviceClient().create(resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + if (inner != null) { + return new ArchiveVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArchiveVersion create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + ArchiveVersionInner inner = + this + .serviceClient() + .create(resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context); + if (inner != null) { + return new ArchiveVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName) { + this.serviceClient().delete(resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + } + + public void delete( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context) { + this + .serviceClient() + .delete(resourceGroupName, registryName, packageType, archiveName, archiveVersionName, context); + } + + private ArchiveVersionsClient 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/ArchivesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchivesClientImpl.java new file mode 100644 index 0000000000000..c8eb27141fbf4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchivesClientImpl.java @@ -0,0 +1,1466 @@ +// Copyright (c) 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ArchivesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ArchiveInner; +import com.azure.resourcemanager.containerregistry.generated.models.ArchiveListResult; +import com.azure.resourcemanager.containerregistry.generated.models.ArchiveUpdateParameters; +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 ArchivesClient. */ +public final class ArchivesClientImpl implements ArchivesClient { + /** The proxy service used to perform REST calls. */ + private final ArchivesService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ArchivesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ArchivesClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = RestProxy.create(ArchivesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientArchives to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + public interface ArchivesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives") + @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, + @PathParam("packageType") String packageType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}") + @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("packageType") String packageType, + @PathParam("archiveName") String archiveName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}") + @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("packageType") String packageType, + @PathParam("archiveName") String archiveName, + @BodyParam("application/json") ArchiveInner archiveCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}") + @ExpectedResponses({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("packageType") String packageType, + @PathParam("archiveName") String archiveName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}") + @ExpectedResponses({200}) + @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("packageType") String packageType, + @PathParam("archiveName") String archiveName, + @BodyParam("application/json") ArchiveUpdateParameters archiveUpdateParameters, + @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 archives for the specified container registry and package type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archives for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String packageType) { + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + 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 archives for the specified container registry and package type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archives for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String packageType, 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all archives for the specified container registry and package type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archives for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String packageType) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, packageType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all archives for the specified container registry and package type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archives for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String packageType, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, packageType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all archives for the specified container registry and package type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archives for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String packageType) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, packageType)); + } + + /** + * Lists all archives for the specified container registry and package type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archives for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String packageType, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, packageType, context)); + } + + /** + * Gets the properties of the archive. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archive along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String packageType, String archiveName) { + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the archive. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archive along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String packageType, String archiveName, 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + accept, + context); + } + + /** + * Gets the properties of the archive. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archive on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String packageType, String archiveName) { + return getWithResponseAsync(resourceGroupName, registryName, packageType, archiveName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the archive. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archive along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, packageType, archiveName, context).block(); + } + + /** + * Gets the properties of the archive. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArchiveInner get(String resourceGroupName, String registryName, String packageType, String archiveName) { + return getWithResponse(resourceGroupName, registryName, packageType, archiveName, Context.NONE).getValue(); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters) { + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + if (archiveCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter archiveCreateParameters is required and cannot be null.")); + } else { + archiveCreateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + archiveCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters, + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + if (archiveCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter archiveCreateParameters is required and cannot be null.")); + } else { + archiveCreateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + archiveCreateParameters, + accept, + context); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArchiveInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, packageType, archiveName, archiveCreateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ArchiveInner.class, ArchiveInner.class, this.client.getContext()); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArchiveInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, packageType, archiveName, archiveCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ArchiveInner.class, ArchiveInner.class, context); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArchiveInner> beginCreate( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters) { + return this + .beginCreateAsync(resourceGroupName, registryName, packageType, archiveName, archiveCreateParameters) + .getSyncPoller(); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArchiveInner> beginCreate( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters, + Context context) { + return this + .beginCreateAsync( + resourceGroupName, registryName, packageType, archiveName, archiveCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, packageType, archiveName, archiveCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, packageType, archiveName, archiveCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArchiveInner create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters) { + return createAsync(resourceGroupName, registryName, packageType, archiveName, archiveCreateParameters).block(); + } + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveCreateParameters The parameters for creating a archive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArchiveInner create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveInner archiveCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, packageType, archiveName, archiveCreateParameters, context) + .block(); + } + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String packageType, String archiveName) { + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String packageType, String archiveName, 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + accept, + context); + } + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String packageType, String archiveName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, packageType, archiveName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, packageType, archiveName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String packageType, String archiveName) { + return this.beginDeleteAsync(resourceGroupName, registryName, packageType, archiveName).getSyncPoller(); + } + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, registryName, packageType, archiveName, context) + .getSyncPoller(); + } + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String packageType, String archiveName) { + return beginDeleteAsync(resourceGroupName, registryName, packageType, archiveName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, packageType, archiveName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 packageType, String archiveName) { + deleteAsync(resourceGroupName, registryName, packageType, archiveName).block(); + } + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 packageType, String archiveName, Context context) { + deleteAsync(resourceGroupName, registryName, packageType, archiveName, context).block(); + } + + /** + * Updates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveUpdateParameters The parameters for updating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveUpdateParameters archiveUpdateParameters) { + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + if (archiveUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter archiveUpdateParameters is required and cannot be null.")); + } else { + archiveUpdateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + archiveUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveUpdateParameters The parameters for updating a archive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveUpdateParameters archiveUpdateParameters, + 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 (packageType == null) { + return Mono.error(new IllegalArgumentException("Parameter packageType is required and cannot be null.")); + } + if (archiveName == null) { + return Mono.error(new IllegalArgumentException("Parameter archiveName is required and cannot be null.")); + } + if (archiveUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter archiveUpdateParameters is required and cannot be null.")); + } else { + archiveUpdateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + packageType, + archiveName, + archiveUpdateParameters, + accept, + context); + } + + /** + * Updates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveUpdateParameters The parameters for updating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveUpdateParameters archiveUpdateParameters) { + return updateWithResponseAsync( + resourceGroupName, registryName, packageType, archiveName, archiveUpdateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveUpdateParameters The parameters for updating a archive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveUpdateParameters archiveUpdateParameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, registryName, packageType, archiveName, archiveUpdateParameters, context) + .block(); + } + + /** + * Updates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveUpdateParameters The parameters for updating a archive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 archive for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArchiveInner update( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + ArchiveUpdateParameters archiveUpdateParameters) { + return updateWithResponse( + resourceGroupName, registryName, packageType, archiveName, archiveUpdateParameters, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 archives for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 archives for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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/ArchivesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchivesImpl.java new file mode 100644 index 0000000000000..cb7df4558dc3b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ArchivesImpl.java @@ -0,0 +1,219 @@ +// Copyright (c) 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.ArchivesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ArchiveInner; +import com.azure.resourcemanager.containerregistry.generated.models.Archive; +import com.azure.resourcemanager.containerregistry.generated.models.Archives; + +public final class ArchivesImpl implements Archives { + private static final ClientLogger LOGGER = new ClientLogger(ArchivesImpl.class); + + private final ArchivesClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ArchivesImpl( + ArchivesClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName, String packageType) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, packageType); + return Utils.mapPage(inner, inner1 -> new ArchiveImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, String packageType, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, packageType, context); + return Utils.mapPage(inner, inner1 -> new ArchiveImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, packageType, archiveName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ArchiveImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Archive get(String resourceGroupName, String registryName, String packageType, String archiveName) { + ArchiveInner inner = this.serviceClient().get(resourceGroupName, registryName, packageType, archiveName); + if (inner != null) { + return new ArchiveImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String packageType, String archiveName) { + this.serviceClient().delete(resourceGroupName, registryName, packageType, archiveName); + } + + public void delete( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, packageType, archiveName, context); + } + + public Archive 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 packageType = Utils.getValueFromIdByName(id, "packages"); + if (packageType == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + String archiveName = Utils.getValueFromIdByName(id, "archives"); + if (archiveName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'archives'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, packageType, archiveName, 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 packageType = Utils.getValueFromIdByName(id, "packages"); + if (packageType == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + String archiveName = Utils.getValueFromIdByName(id, "archives"); + if (archiveName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'archives'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, packageType, archiveName, 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 packageType = Utils.getValueFromIdByName(id, "packages"); + if (packageType == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + String archiveName = Utils.getValueFromIdByName(id, "archives"); + if (archiveName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'archives'.", id))); + } + this.delete(resourceGroupName, registryName, packageType, archiveName, 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 packageType = Utils.getValueFromIdByName(id, "packages"); + if (packageType == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + String archiveName = Utils.getValueFromIdByName(id, "archives"); + if (archiveName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'archives'.", id))); + } + this.delete(resourceGroupName, registryName, packageType, archiveName, context); + } + + private ArchivesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ArchiveImpl define(String name) { + return new ArchiveImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CacheRuleImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CacheRuleImpl.java new file mode 100644 index 0000000000000..ac10ffde8bae0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CacheRuleImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) 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.CacheRuleInner; +import com.azure.resourcemanager.containerregistry.generated.models.CacheRule; +import com.azure.resourcemanager.containerregistry.generated.models.CacheRuleUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import java.time.OffsetDateTime; + +public final class CacheRuleImpl implements CacheRule, CacheRule.Definition, CacheRule.Update { + private CacheRuleInner 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String credentialSetResourceId() { + return this.innerModel().credentialSetResourceId(); + } + + public String sourceRepository() { + return this.innerModel().sourceRepository(); + } + + public String targetRepository() { + return this.innerModel().targetRepository(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CacheRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String cacheRuleName; + + private CacheRuleUpdateParameters updateCacheRuleUpdateParameters; + + public CacheRuleImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public CacheRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getCacheRules() + .create(resourceGroupName, registryName, cacheRuleName, this.innerModel(), Context.NONE); + return this; + } + + public CacheRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCacheRules() + .create(resourceGroupName, registryName, cacheRuleName, this.innerModel(), context); + return this; + } + + CacheRuleImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new CacheRuleInner(); + this.serviceManager = serviceManager; + this.cacheRuleName = name; + } + + public CacheRuleImpl update() { + this.updateCacheRuleUpdateParameters = new CacheRuleUpdateParameters(); + return this; + } + + public CacheRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCacheRules() + .update(resourceGroupName, registryName, cacheRuleName, updateCacheRuleUpdateParameters, Context.NONE); + return this; + } + + public CacheRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCacheRules() + .update(resourceGroupName, registryName, cacheRuleName, updateCacheRuleUpdateParameters, context); + return this; + } + + CacheRuleImpl( + CacheRuleInner 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.cacheRuleName = Utils.getValueFromIdByName(innerObject.id(), "cacheRules"); + } + + public CacheRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCacheRules() + .getWithResponse(resourceGroupName, registryName, cacheRuleName, Context.NONE) + .getValue(); + return this; + } + + public CacheRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCacheRules() + .getWithResponse(resourceGroupName, registryName, cacheRuleName, context) + .getValue(); + return this; + } + + public CacheRuleImpl withCredentialSetResourceId(String credentialSetResourceId) { + if (isInCreateMode()) { + this.innerModel().withCredentialSetResourceId(credentialSetResourceId); + return this; + } else { + this.updateCacheRuleUpdateParameters.withCredentialSetResourceId(credentialSetResourceId); + return this; + } + } + + public CacheRuleImpl withSourceRepository(String sourceRepository) { + this.innerModel().withSourceRepository(sourceRepository); + return this; + } + + public CacheRuleImpl withTargetRepository(String targetRepository) { + this.innerModel().withTargetRepository(targetRepository); + 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/CacheRulesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CacheRulesClientImpl.java new file mode 100644 index 0000000000000..ccc0202d6fa37 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CacheRulesClientImpl.java @@ -0,0 +1,1480 @@ +// Copyright (c) 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.CacheRulesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CacheRuleInner; +import com.azure.resourcemanager.containerregistry.generated.models.CacheRuleUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.CacheRulesListResult; +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 CacheRulesClient. */ +public final class CacheRulesClientImpl implements CacheRulesClient { + /** The proxy service used to perform REST calls. */ + private final CacheRulesService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of CacheRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CacheRulesClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(CacheRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientCacheRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + public interface CacheRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules") + @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( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}") + @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("cacheRuleName") String cacheRuleName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}") + @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("cacheRuleName") String cacheRuleName, + @BodyParam("application/json") CacheRuleInner cacheRuleCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}") + @ExpectedResponses({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("cacheRuleName") String cacheRuleName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}") + @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("cacheRuleName") String cacheRuleName, + @BodyParam("application/json") CacheRuleUpdateParameters cacheRuleUpdateParameters, + @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 cache rule resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 cache rules for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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 cache rule resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 cache rules for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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 cache rule resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 cache rules for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all cache rule resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 cache rules for a container registry as paginated response with {@link + * PagedFlux}. + */ + @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 cache rule resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 cache rules for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all cache rule resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 cache rules for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the specified cache rule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cache rule resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String cacheRuleName) { + 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 (cacheRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + cacheRuleName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified cache rule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cache rule resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String cacheRuleName, 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 (cacheRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + cacheRuleName, + accept, + context); + } + + /** + * Gets the properties of the specified cache rule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cache rule resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String cacheRuleName) { + return getWithResponseAsync(resourceGroupName, registryName, cacheRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the specified cache rule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cache rule resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String cacheRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, cacheRuleName, context).block(); + } + + /** + * Gets the properties of the specified cache rule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cache rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CacheRuleInner get(String resourceGroupName, String registryName, String cacheRuleName) { + return getWithResponse(resourceGroupName, registryName, cacheRuleName, Context.NONE).getValue(); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String cacheRuleName, CacheRuleInner cacheRuleCreateParameters) { + 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 (cacheRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); + } + if (cacheRuleCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter cacheRuleCreateParameters is required and cannot be null.")); + } else { + cacheRuleCreateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + cacheRuleName, + cacheRuleCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleInner cacheRuleCreateParameters, + 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 (cacheRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); + } + if (cacheRuleCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter cacheRuleCreateParameters is required and cannot be null.")); + } else { + cacheRuleCreateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + cacheRuleName, + cacheRuleCreateParameters, + accept, + context); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CacheRuleInner> beginCreateAsync( + String resourceGroupName, String registryName, String cacheRuleName, CacheRuleInner cacheRuleCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CacheRuleInner.class, + CacheRuleInner.class, + this.client.getContext()); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CacheRuleInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleInner cacheRuleCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CacheRuleInner.class, CacheRuleInner.class, context); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CacheRuleInner> beginCreate( + String resourceGroupName, String registryName, String cacheRuleName, CacheRuleInner cacheRuleCreateParameters) { + return this + .beginCreateAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters) + .getSyncPoller(); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CacheRuleInner> beginCreate( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleInner cacheRuleCreateParameters, + Context context) { + return this + .beginCreateAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String cacheRuleName, CacheRuleInner cacheRuleCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleInner cacheRuleCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CacheRuleInner create( + String resourceGroupName, String registryName, String cacheRuleName, CacheRuleInner cacheRuleCreateParameters) { + return createAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters).block(); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CacheRuleInner create( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleInner cacheRuleCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters, context).block(); + } + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String cacheRuleName) { + 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 (cacheRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + cacheRuleName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String cacheRuleName, 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 (cacheRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + cacheRuleName, + accept, + context); + } + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String cacheRuleName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, cacheRuleName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String cacheRuleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, cacheRuleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String cacheRuleName) { + return this.beginDeleteAsync(resourceGroupName, registryName, cacheRuleName).getSyncPoller(); + } + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String cacheRuleName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, cacheRuleName, context).getSyncPoller(); + } + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String cacheRuleName) { + return beginDeleteAsync(resourceGroupName, registryName, cacheRuleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String cacheRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, cacheRuleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cacheRuleName) { + deleteAsync(resourceGroupName, registryName, cacheRuleName).block(); + } + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cacheRuleName, Context context) { + deleteAsync(resourceGroupName, registryName, cacheRuleName, context).block(); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters) { + 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 (cacheRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); + } + if (cacheRuleUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter cacheRuleUpdateParameters is required and cannot be null.")); + } else { + cacheRuleUpdateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + cacheRuleName, + cacheRuleUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters, + 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 (cacheRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); + } + if (cacheRuleUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter cacheRuleUpdateParameters is required and cannot be null.")); + } else { + cacheRuleUpdateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + cacheRuleName, + cacheRuleUpdateParameters, + accept, + context); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CacheRuleInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CacheRuleInner.class, + CacheRuleInner.class, + this.client.getContext()); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CacheRuleInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CacheRuleInner.class, CacheRuleInner.class, context); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CacheRuleInner> beginUpdate( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters) { + return this + .beginUpdateAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters) + .getSyncPoller(); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CacheRuleInner> beginUpdate( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CacheRuleInner update( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters) { + return updateAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters).block(); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cache rule for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CacheRuleInner update( + String resourceGroupName, + String registryName, + String cacheRuleName, + CacheRuleUpdateParameters cacheRuleUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 cache rules for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 cache rules for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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/CacheRulesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CacheRulesImpl.java new file mode 100644 index 0000000000000..23ad6edbb1bd0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CacheRulesImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) 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.CacheRulesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CacheRuleInner; +import com.azure.resourcemanager.containerregistry.generated.models.CacheRule; +import com.azure.resourcemanager.containerregistry.generated.models.CacheRules; + +public final class CacheRulesImpl implements CacheRules { + private static final ClientLogger LOGGER = new ClientLogger(CacheRulesImpl.class); + + private final CacheRulesClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public CacheRulesImpl( + CacheRulesClient 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 CacheRuleImpl(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 CacheRuleImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String cacheRuleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, cacheRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CacheRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CacheRule get(String resourceGroupName, String registryName, String cacheRuleName) { + CacheRuleInner inner = this.serviceClient().get(resourceGroupName, registryName, cacheRuleName); + if (inner != null) { + return new CacheRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String cacheRuleName) { + this.serviceClient().delete(resourceGroupName, registryName, cacheRuleName); + } + + public void delete(String resourceGroupName, String registryName, String cacheRuleName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, cacheRuleName, context); + } + + public CacheRule 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 cacheRuleName = Utils.getValueFromIdByName(id, "cacheRules"); + if (cacheRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cacheRules'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, cacheRuleName, 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 cacheRuleName = Utils.getValueFromIdByName(id, "cacheRules"); + if (cacheRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cacheRules'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, cacheRuleName, 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 cacheRuleName = Utils.getValueFromIdByName(id, "cacheRules"); + if (cacheRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cacheRules'.", id))); + } + this.delete(resourceGroupName, registryName, cacheRuleName, 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 cacheRuleName = Utils.getValueFromIdByName(id, "cacheRules"); + if (cacheRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cacheRules'.", id))); + } + this.delete(resourceGroupName, registryName, cacheRuleName, context); + } + + private CacheRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public CacheRuleImpl define(String name) { + return new CacheRuleImpl(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..5ad88a4261fcf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesClientImpl.java @@ -0,0 +1,1859 @@ +// Copyright (c) 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.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 { + /** 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") + public interface ConnectedRegistriesService { + @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"}) + @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"}) + @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); + } + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, filter, context)); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + return getWithResponseAsync(resourceGroupName, registryName, connectedRegistryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, connectedRegistryName, context).block(); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getWithResponse(resourceGroupName, registryName, connectedRegistryName, Context.NONE).getValue(); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectedRegistryInner> beginCreate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + return this + .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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectedRegistryInner> beginCreate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + return this + .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. The name is case insensitive. + * @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 on successful completion of + * {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of + * {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String connectedRegistryName) { + return this.beginDeleteAsync(resourceGroupName, registryName, connectedRegistryName).getSyncPoller(); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, connectedRegistryName, context).getSyncPoller(); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectedRegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + return this + .beginUpdateAsync(resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters) + .getSyncPoller(); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectedRegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + return this + .beginUpdateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 on successful completion of + * {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of + * {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName) { + return this.beginDeactivateAsync(resourceGroupName, registryName, connectedRegistryName).getSyncPoller(); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return this + .beginDeactivateAsync(resourceGroupName, registryName, connectedRegistryName, context) + .getSyncPoller(); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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..6d4da11b0aa62 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) 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; + +public final class ConnectedRegistriesImpl implements ConnectedRegistries { + private static 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 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 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 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 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 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..38a3f874a5326 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistryImpl.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.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 List notificationsList() { + List inner = this.innerModel().notificationsList(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 withNotificationsList(List notificationsList) { + if (isInCreateMode()) { + this.innerModel().withNotificationsList(notificationsList); + return this; + } else { + this.updateConnectedRegistryUpdateParameters.withNotificationsList(notificationsList); + 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..7feeaed6ddef4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientBuilder.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.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.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 ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @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 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 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 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() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ContainerRegistryManagementClientImpl client = + new ContainerRegistryManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + this.subscriptionId, + localEndpoint); + 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..af3226ea15a64 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientImpl.java @@ -0,0 +1,529 @@ +// Copyright (c) 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.CoreUtils; +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.ArchiveVersionsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ArchivesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.CacheRulesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ConnectedRegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ContainerRegistryManagementClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.CredentialSetsClient; +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 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 { + /** The ID of the target subscription. The value must be an UUID. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @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 ArchivesClient object to access its operations. */ + private final ArchivesClient archives; + + /** + * Gets the ArchivesClient object to access its operations. + * + * @return the ArchivesClient object. + */ + public ArchivesClient getArchives() { + return this.archives; + } + + /** The ArchiveVersionsClient object to access its operations. */ + private final ArchiveVersionsClient archiveVersions; + + /** + * Gets the ArchiveVersionsClient object to access its operations. + * + * @return the ArchiveVersionsClient object. + */ + public ArchiveVersionsClient getArchiveVersions() { + return this.archiveVersions; + } + + /** The CacheRulesClient object to access its operations. */ + private final CacheRulesClient cacheRules; + + /** + * Gets the CacheRulesClient object to access its operations. + * + * @return the CacheRulesClient object. + */ + public CacheRulesClient getCacheRules() { + return this.cacheRules; + } + + /** 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 CredentialSetsClient object to access its operations. */ + private final CredentialSetsClient credentialSets; + + /** + * Gets the CredentialSetsClient object to access its operations. + * + * @return the CredentialSetsClient object. + */ + public CredentialSetsClient getCredentialSets() { + return this.credentialSets; + } + + /** 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 ID of the target subscription. The value must be an UUID. + * @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.archives = new ArchivesClientImpl(this); + this.archiveVersions = new ArchiveVersionsClientImpl(this); + this.cacheRules = new CacheRulesClientImpl(this); + this.connectedRegistries = new ConnectedRegistriesClientImpl(this); + this.credentialSets = new CredentialSetsClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), 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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerRegistryManagementClientImpl.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CredentialSetImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CredentialSetImpl.java new file mode 100644 index 0000000000000..7c25bde6aab68 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CredentialSetImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) 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.CredentialSetInner; +import com.azure.resourcemanager.containerregistry.generated.models.AuthCredential; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialSet; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialSetUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class CredentialSetImpl implements CredentialSet, CredentialSet.Definition, CredentialSet.Update { + private CredentialSetInner 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String loginServer() { + return this.innerModel().loginServer(); + } + + public List authCredentials() { + List inner = this.innerModel().authCredentials(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CredentialSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String credentialSetName; + + private CredentialSetUpdateParameters updateCredentialSetUpdateParameters; + + public CredentialSetImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public CredentialSet create() { + this.innerObject = + serviceManager + .serviceClient() + .getCredentialSets() + .create(resourceGroupName, registryName, credentialSetName, this.innerModel(), Context.NONE); + return this; + } + + public CredentialSet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCredentialSets() + .create(resourceGroupName, registryName, credentialSetName, this.innerModel(), context); + return this; + } + + CredentialSetImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new CredentialSetInner(); + this.serviceManager = serviceManager; + this.credentialSetName = name; + } + + public CredentialSetImpl update() { + this.updateCredentialSetUpdateParameters = new CredentialSetUpdateParameters(); + return this; + } + + public CredentialSet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCredentialSets() + .update( + resourceGroupName, + registryName, + credentialSetName, + updateCredentialSetUpdateParameters, + Context.NONE); + return this; + } + + public CredentialSet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCredentialSets() + .update( + resourceGroupName, registryName, credentialSetName, updateCredentialSetUpdateParameters, context); + return this; + } + + CredentialSetImpl( + CredentialSetInner 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.credentialSetName = Utils.getValueFromIdByName(innerObject.id(), "credentialSets"); + } + + public CredentialSet refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCredentialSets() + .getWithResponse(resourceGroupName, registryName, credentialSetName, Context.NONE) + .getValue(); + return this; + } + + public CredentialSet refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCredentialSets() + .getWithResponse(resourceGroupName, registryName, credentialSetName, context) + .getValue(); + return this; + } + + public CredentialSetImpl withIdentity(IdentityProperties identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateCredentialSetUpdateParameters.withIdentity(identity); + return this; + } + } + + public CredentialSetImpl withLoginServer(String loginServer) { + this.innerModel().withLoginServer(loginServer); + return this; + } + + public CredentialSetImpl withAuthCredentials(List authCredentials) { + if (isInCreateMode()) { + this.innerModel().withAuthCredentials(authCredentials); + return this; + } else { + this.updateCredentialSetUpdateParameters.withAuthCredentials(authCredentials); + 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/CredentialSetsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CredentialSetsClientImpl.java new file mode 100644 index 0000000000000..7d176b7a2ed88 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CredentialSetsClientImpl.java @@ -0,0 +1,1524 @@ +// Copyright (c) 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.CredentialSetsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CredentialSetInner; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialSetListResult; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialSetUpdateParameters; +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 CredentialSetsClient. */ +public final class CredentialSetsClientImpl implements CredentialSetsClient { + /** The proxy service used to perform REST calls. */ + private final CredentialSetsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of CredentialSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CredentialSetsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(CredentialSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientCredentialSets to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + public interface CredentialSetsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets") + @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( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}") + @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("credentialSetName") String credentialSetName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}") + @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("credentialSetName") String credentialSetName, + @BodyParam("application/json") CredentialSetInner credentialSetCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}") + @ExpectedResponses({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("credentialSetName") String credentialSetName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}") + @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("credentialSetName") String credentialSetName, + @BodyParam("application/json") CredentialSetUpdateParameters credentialSetUpdateParameters, + @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 credential set resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 credential sets for a container registry along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 = "2023-11-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 credential set resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 credential sets for a container registry along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 = "2023-11-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 credential set resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 credential sets for a container registry as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all credential set resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 credential sets for a container registry as paginated response with + * {@link PagedFlux}. + */ + @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 credential set resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 credential sets for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all credential set resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 credential sets for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the specified credential set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 credential set resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String credentialSetName) { + 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 (credentialSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + credentialSetName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified credential set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 credential set resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String credentialSetName, 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 (credentialSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + credentialSetName, + accept, + context); + } + + /** + * Gets the properties of the specified credential set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 credential set resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String credentialSetName) { + return getWithResponseAsync(resourceGroupName, registryName, credentialSetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the specified credential set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 credential set resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String credentialSetName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, credentialSetName, context).block(); + } + + /** + * Gets the properties of the specified credential set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 credential set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialSetInner get(String resourceGroupName, String registryName, String credentialSetName) { + return getWithResponse(resourceGroupName, registryName, credentialSetName, Context.NONE).getValue(); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters) { + 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 (credentialSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); + } + if (credentialSetCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter credentialSetCreateParameters is required and cannot be null.")); + } else { + credentialSetCreateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + credentialSetName, + credentialSetCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters, + 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 (credentialSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); + } + if (credentialSetCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter credentialSetCreateParameters is required and cannot be null.")); + } else { + credentialSetCreateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + credentialSetName, + credentialSetCreateParameters, + accept, + context); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CredentialSetInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CredentialSetInner.class, + CredentialSetInner.class, + this.client.getContext()); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CredentialSetInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CredentialSetInner.class, CredentialSetInner.class, context); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CredentialSetInner> beginCreate( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters) { + return this + .beginCreateAsync(resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters) + .getSyncPoller(); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CredentialSetInner> beginCreate( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters, + Context context) { + return this + .beginCreateAsync( + resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialSetInner create( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters) { + return createAsync(resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters).block(); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialSetInner create( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetInner credentialSetCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters, context) + .block(); + } + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String credentialSetName) { + 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 (credentialSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + credentialSetName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String credentialSetName, 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 (credentialSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + credentialSetName, + accept, + context); + } + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String credentialSetName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, credentialSetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String credentialSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, credentialSetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String credentialSetName) { + return this.beginDeleteAsync(resourceGroupName, registryName, credentialSetName).getSyncPoller(); + } + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String credentialSetName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, credentialSetName, context).getSyncPoller(); + } + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String credentialSetName) { + return beginDeleteAsync(resourceGroupName, registryName, credentialSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String credentialSetName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, credentialSetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 credentialSetName) { + deleteAsync(resourceGroupName, registryName, credentialSetName).block(); + } + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 credentialSetName, Context context) { + deleteAsync(resourceGroupName, registryName, credentialSetName, context).block(); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters) { + 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 (credentialSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); + } + if (credentialSetUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter credentialSetUpdateParameters is required and cannot be null.")); + } else { + credentialSetUpdateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + credentialSetName, + credentialSetUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters, + 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 (credentialSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); + } + if (credentialSetUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter credentialSetUpdateParameters is required and cannot be null.")); + } else { + credentialSetUpdateParameters.validate(); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + credentialSetName, + credentialSetUpdateParameters, + accept, + context); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CredentialSetInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CredentialSetInner.class, + CredentialSetInner.class, + this.client.getContext()); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CredentialSetInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CredentialSetInner.class, CredentialSetInner.class, context); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CredentialSetInner> beginUpdate( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters) { + return this + .beginUpdateAsync(resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters) + .getSyncPoller(); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a credential set resource for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CredentialSetInner> beginUpdate( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters, + Context context) { + return this + .beginUpdateAsync( + resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialSetInner update( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters) { + return updateAsync(resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters).block(); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 credential set resource for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialSetInner update( + String resourceGroupName, + String registryName, + String credentialSetName, + CredentialSetUpdateParameters credentialSetUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 credential sets for a container registry along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 credential sets for a container registry along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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/CredentialSetsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CredentialSetsImpl.java new file mode 100644 index 0000000000000..7adf3ce777b9a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CredentialSetsImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) 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.CredentialSetsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CredentialSetInner; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialSet; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialSets; + +public final class CredentialSetsImpl implements CredentialSets { + private static final ClientLogger LOGGER = new ClientLogger(CredentialSetsImpl.class); + + private final CredentialSetsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public CredentialSetsImpl( + CredentialSetsClient 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 CredentialSetImpl(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 CredentialSetImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String credentialSetName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, credentialSetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CredentialSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CredentialSet get(String resourceGroupName, String registryName, String credentialSetName) { + CredentialSetInner inner = this.serviceClient().get(resourceGroupName, registryName, credentialSetName); + if (inner != null) { + return new CredentialSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String credentialSetName) { + this.serviceClient().delete(resourceGroupName, registryName, credentialSetName); + } + + public void delete(String resourceGroupName, String registryName, String credentialSetName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, credentialSetName, context); + } + + public CredentialSet 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 credentialSetName = Utils.getValueFromIdByName(id, "credentialSets"); + if (credentialSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'credentialSets'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, credentialSetName, 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 credentialSetName = Utils.getValueFromIdByName(id, "credentialSets"); + if (credentialSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'credentialSets'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, credentialSetName, 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 credentialSetName = Utils.getValueFromIdByName(id, "credentialSets"); + if (credentialSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'credentialSets'.", id))); + } + this.delete(resourceGroupName, registryName, credentialSetName, 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 credentialSetName = Utils.getValueFromIdByName(id, "credentialSets"); + if (credentialSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'credentialSets'.", id))); + } + this.delete(resourceGroupName, registryName, credentialSetName, context); + } + + private CredentialSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public CredentialSetImpl define(String name) { + return new CredentialSetImpl(name, this.manager()); + } +} 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..ce84fcc07aec0 --- /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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 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..e838d063e0863 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesClientImpl.java @@ -0,0 +1,1163 @@ +// Copyright (c) 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.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 { + /** 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") + public interface ExportPipelinesService { + @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( + "/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({"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, + @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 export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String exportPipelineName) { + return getWithResponseAsync(resourceGroupName, registryName, exportPipelineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, exportPipelineName, context).block(); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getWithResponse(resourceGroupName, registryName, exportPipelineName, Context.NONE).getValue(); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + return this + .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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + return this + .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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + accept, + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + accept, + context); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String exportPipelineName) { + return this.beginDeleteAsync(resourceGroupName, registryName, exportPipelineName).getSyncPoller(); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, exportPipelineName, context).getSyncPoller(); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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..848edcf58afd5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) 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; + +public final class ExportPipelinesImpl implements ExportPipelines { + private static 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 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 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 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 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 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..b3e0ef996fc4a --- /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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 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..8f7dcd336a3ff --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesClientImpl.java @@ -0,0 +1,1163 @@ +// Copyright (c) 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.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 { + /** 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") + public interface ImportPipelinesService { + @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( + "/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({"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, + @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 import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String importPipelineName) { + return getWithResponseAsync(resourceGroupName, registryName, importPipelineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, importPipelineName, context).block(); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getWithResponse(resourceGroupName, registryName, importPipelineName, Context.NONE).getValue(); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ImportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + return this + .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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ImportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + return this + .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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + accept, + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + accept, + context); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String importPipelineName) { + return this.beginDeleteAsync(resourceGroupName, registryName, importPipelineName).getSyncPoller(); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, importPipelineName, context).getSyncPoller(); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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..0714525134a7f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) 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; + +public final class ImportPipelinesImpl implements ImportPipelines { + private static 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 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 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 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 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 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..a029d5784f9ad --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,277 @@ +// Copyright (c) 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.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 { + /** 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") + public 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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 as paginated response with {@link + * PagedFlux}. + */ + @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 as paginated response with {@link + * PagedFlux}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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..2dd610821acaf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsImpl.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.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; + +public final class OperationsImpl implements Operations { + private static 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..7c2a28b993ecc --- /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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 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..0c2aa7313a440 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsClientImpl.java @@ -0,0 +1,1154 @@ +// Copyright (c) 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.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 { + /** 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") + public interface PipelineRunsService { + @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( + "/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({"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, + @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 pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String pipelineRunName) { + return getWithResponseAsync(resourceGroupName, registryName, pipelineRunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, pipelineRunName, context).block(); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getWithResponse(resourceGroupName, registryName, pipelineRunName, Context.NONE).getValue(); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PipelineRunInner> beginCreate( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + return this + .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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PipelineRunInner> beginCreate( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + return this + .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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + accept, + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + accept, + context); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String pipelineRunName) { + return this.beginDeleteAsync(resourceGroupName, registryName, pipelineRunName).getSyncPoller(); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, pipelineRunName, context).getSyncPoller(); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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..c90d34eaa2b63 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) 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; + +public final class PipelineRunsImpl implements PipelineRuns { + private static 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 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 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 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 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 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..ce667ca48c481 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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..da070ec77c935 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1193 @@ +// Copyright (c) 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.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 { + /** 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") + public interface PrivateEndpointConnectionsService { + @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( + "/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("{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); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated + * response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated + * response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated + * response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, context).block(); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return this + .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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return this + .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. The name is case insensitive. + * @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 on successful completion + * of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion + * of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return this.beginDeleteAsync(resourceGroupName, registryName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + return this + .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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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..1d9b07f6d4550 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) 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; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static 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 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 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 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 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 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..9675eb60462fe --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesClientImpl.java @@ -0,0 +1,3752 @@ +// Copyright (c) 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.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 { + /** 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") + public 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}/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"}) + @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}/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/{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"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateLinkResources/{groupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPrivateLinkResource( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("groupName") String groupName, + @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"}) + @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> 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> 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> 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginImportImage( + String resourceGroupName, String registryName, ImportImageParameters parameters) { + return this.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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginImportImage( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + return this.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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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 on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + RegistryNameCheckRequest registryNameCheckRequest) { + return checkNameAvailabilityWithResponseAsync(registryNameCheckRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, Context context) { + return checkNameAvailabilityWithResponseAsync(registryNameCheckRequest, 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) + public RegistryNameStatusInner checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest) { + return checkNameAvailabilityWithResponse(registryNameCheckRequest, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, registryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginCreate( + String resourceGroupName, String registryName, RegistryInner registry) { + return this.beginCreateAsync(resourceGroupName, registryName, registry).getSyncPoller(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginCreate( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + return this.beginCreateAsync(resourceGroupName, registryName, registry, context).getSyncPoller(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName) { + return this.beginDeleteAsync(resourceGroupName, registryName).getSyncPoller(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, context).getSyncPoller(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginUpdate( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return this.beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters).getSyncPoller(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listUsagesAsync(String resourceGroupName, String registryName) { + return listUsagesWithResponseAsync(resourceGroupName, registryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context) { + return listUsagesWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 listUsagesWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated response + * with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response + * with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response + * with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listPrivateLinkResourcesAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resource by a specified group name for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPrivateLinkResourceWithResponseAsync( + String resourceGroupName, String registryName, String groupName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPrivateLinkResource( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + groupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resource by a specified group name for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPrivateLinkResourceWithResponseAsync( + String resourceGroupName, String registryName, String groupName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String apiVersion = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getPrivateLinkResource( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + groupName, + accept, + context); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resource by a specified group name for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPrivateLinkResourceAsync( + String resourceGroupName, String registryName, String groupName) { + return getPrivateLinkResourceWithResponseAsync(resourceGroupName, registryName, groupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resource by a specified group name for a container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPrivateLinkResourceWithResponse( + String resourceGroupName, String registryName, String groupName, Context context) { + return getPrivateLinkResourceWithResponseAsync(resourceGroupName, registryName, groupName, context).block(); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resource by a specified group name for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner getPrivateLinkResource( + String resourceGroupName, String registryName, String groupName) { + return getPrivateLinkResourceWithResponse(resourceGroupName, registryName, groupName, Context.NONE).getValue(); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listCredentialsAsync( + String resourceGroupName, String registryName) { + return listCredentialsWithResponseAsync(resourceGroupName, registryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context) { + return listCredentialsWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 listCredentialsWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateCredentialAsync( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { + return regenerateCredentialWithResponseAsync(resourceGroupName, registryName, regenerateCredentialParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context) { + return regenerateCredentialWithResponseAsync( + resourceGroupName, registryName, regenerateCredentialParameters, context) + .block(); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 regenerateCredentialWithResponse( + resourceGroupName, registryName, regenerateCredentialParameters, Context.NONE) + .getValue(); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenerateCredentialsResultInner> + beginGenerateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters) { + return this + .beginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters) + .getSyncPoller(); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenerateCredentialsResultInner> + beginGenerateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + return this + .beginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters, context) + .getSyncPoller(); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunInner> beginScheduleRun( + String resourceGroupName, String registryName, RunRequest runRequest) { + return this.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 the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunInner> beginScheduleRun( + String resourceGroupName, String registryName, RunRequest runRequest, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBuildSourceUploadUrlAsync( + String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuildSourceUploadUrlWithResponse( + String resourceGroupName, String registryName, Context context) { + return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName, 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) + public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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..03d9f671ac50f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesImpl.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.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; + +public final class RegistriesImpl implements Registries { + private static 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 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 RegistryNameStatus checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest) { + RegistryNameStatusInner inner = this.serviceClient().checkNameAvailability(registryNameCheckRequest); + if (inner != null) { + return new RegistryNameStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 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 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 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 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 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 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 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 Response getPrivateLinkResourceWithResponse( + String resourceGroupName, String registryName, String groupName, Context context) { + Response inner = + this + .serviceClient() + .getPrivateLinkResourceWithResponse(resourceGroupName, registryName, groupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkResource getPrivateLinkResource(String resourceGroupName, String registryName, String groupName) { + PrivateLinkResourceInner inner = + this.serviceClient().getPrivateLinkResource(resourceGroupName, registryName, groupName); + if (inner != null) { + return new PrivateLinkResourceImpl(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 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 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 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 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 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 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 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..2894e7f313e21 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryImpl.java @@ -0,0 +1,469 @@ +// Copyright (c) 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.MetadataSearch; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 MetadataSearch metadataSearch() { + return this.innerModel().metadataSearch(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 Response listCredentialsWithResponse(Context context) { + return serviceManager.registries().listCredentialsWithResponse(resourceGroupName, registryName, context); + } + + public RegistryListCredentialsResult listCredentials() { + return serviceManager.registries().listCredentials(resourceGroupName, registryName); + } + + public Response regenerateCredentialWithResponse( + RegenerateCredentialParameters regenerateCredentialParameters, Context context) { + return serviceManager + .registries() + .regenerateCredentialWithResponse(resourceGroupName, registryName, regenerateCredentialParameters, context); + } + + public RegistryListCredentialsResult regenerateCredential( + RegenerateCredentialParameters regenerateCredentialParameters) { + return serviceManager + .registries() + .regenerateCredential(resourceGroupName, registryName, regenerateCredentialParameters); + } + + 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 Response getBuildSourceUploadUrlWithResponse(Context context) { + return serviceManager + .registries() + .getBuildSourceUploadUrlWithResponse(resourceGroupName, registryName, context); + } + + public SourceUploadDefinition getBuildSourceUploadUrl() { + return serviceManager.registries().getBuildSourceUploadUrl(resourceGroupName, registryName); + } + + 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; + } + } + + public RegistryImpl withMetadataSearch(MetadataSearch metadataSearch) { + if (isInCreateMode()) { + this.innerModel().withMetadataSearch(metadataSearch); + return this; + } else { + this.updateRegistryUpdateParameters.withMetadataSearch(metadataSearch); + 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..dae7172c1dabc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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..0a9df7447017d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsClientImpl.java @@ -0,0 +1,1482 @@ +// Copyright (c) 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.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 { + /** 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") + public interface ReplicationsService { + @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( + "/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("{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 replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String replicationName) { + return getWithResponseAsync(resourceGroupName, registryName, replicationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, replicationName, context).block(); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getWithResponse(resourceGroupName, registryName, replicationName, Context.NONE).getValue(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationInner> beginCreate( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return this.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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationInner> beginCreate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + return this + .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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName) { + return this.beginDeleteAsync(resourceGroupName, registryName, replicationName).getSyncPoller(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, replicationName, context).getSyncPoller(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationInner> beginUpdate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + return this + .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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationInner> beginUpdate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + return this + .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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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..d8ca4996c8303 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) 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; + +public final class ReplicationsImpl implements Replications { + private static 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 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 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 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 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 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..47b43c0e241cc --- /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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 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..f2c05f9a1e0ca --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunsClientImpl.java @@ -0,0 +1,1324 @@ +// Copyright (c) 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.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 { + /** 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") + public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String runId) { + return getWithResponseAsync(resourceGroupName, registryName, runId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String runId, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, runId, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getWithResponse(resourceGroupName, registryName, runId, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunInner> beginUpdate( + String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { + return this.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 the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunInner> beginUpdate( + String resourceGroupName, + String registryName, + String runId, + RunUpdateParameters runUpdateParameters, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogSasUrlAsync(String resourceGroupName, String registryName, String runId) { + return getLogSasUrlWithResponseAsync(resourceGroupName, registryName, runId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogSasUrlWithResponse( + String resourceGroupName, String registryName, String runId, Context context) { + return getLogSasUrlWithResponseAsync(resourceGroupName, registryName, runId, 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) + public RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId) { + return getLogSasUrlWithResponse(resourceGroupName, registryName, runId, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel(String resourceGroupName, String registryName, String runId) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel( + String resourceGroupName, String registryName, String runId, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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..c0542c1c97e40 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RunsImpl.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.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; + +public final class RunsImpl implements Runs { + private static 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 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 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 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 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 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 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..344548fd7cab7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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..b83ea9a97b5bb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsClientImpl.java @@ -0,0 +1,1476 @@ +// Copyright (c) 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.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 { + /** 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") + public interface ScopeMapsService { + @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( + "/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({"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, + @HeaderParam("Accept") String accept, + 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("{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 scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String scopeMapName) { + return getWithResponseAsync(resourceGroupName, registryName, scopeMapName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, scopeMapName, context).block(); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getWithResponse(resourceGroupName, registryName, scopeMapName, Context.NONE).getValue(); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ScopeMapInner> beginCreate( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return this + .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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ScopeMapInner> beginCreate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + return this + .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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + accept, + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + accept, + context); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String scopeMapName) { + return this.beginDeleteAsync(resourceGroupName, registryName, scopeMapName).getSyncPoller(); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, scopeMapName, context).getSyncPoller(); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ScopeMapInner> beginUpdate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + return this + .beginUpdateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters) + .getSyncPoller(); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ScopeMapInner> beginUpdate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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..cf501ecad8913 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) 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; + +public final class ScopeMapsImpl implements ScopeMaps { + private static 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 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 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 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 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 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..cda44f17785d6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskImpl.java @@ -0,0 +1,363 @@ +// Copyright (c) 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 Response getDetailsWithResponse(Context context) { + return serviceManager.tasks().getDetailsWithResponse(resourceGroupName, registryName, taskName, context); + } + + public Task getDetails() { + return serviceManager.tasks().getDetails(resourceGroupName, registryName, taskName); + } + + 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..1c98ddbc557d8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunImpl.java @@ -0,0 +1,239 @@ +// Copyright (c) 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 Response getDetailsWithResponse(Context context) { + return serviceManager.taskRuns().getDetailsWithResponse(resourceGroupName, registryName, taskRunName, context); + } + + public TaskRun getDetails() { + return serviceManager.taskRuns().getDetails(resourceGroupName, registryName, taskRunName); + } + + 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/TaskRunPropertiesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunPropertiesImpl.java new file mode 100644 index 0000000000000..4ade88da6bb8a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunPropertiesImpl.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.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskRunPropertiesInner; +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.TaskRunProperties; + +public final class TaskRunPropertiesImpl implements TaskRunProperties { + private TaskRunPropertiesInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + TaskRunPropertiesImpl( + TaskRunPropertiesInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 TaskRunPropertiesInner 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/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..3a7417bd85c90 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunsClientImpl.java @@ -0,0 +1,1587 @@ +// Copyright (c) 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.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 { + /** 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String taskRunName) { + return getWithResponseAsync(resourceGroupName, registryName, taskRunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String taskRunName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, taskRunName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getWithResponse(resourceGroupName, registryName, taskRunName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskRunInner> beginCreate( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + return this.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 {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskRunInner> beginCreate( + String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String taskRunName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String taskRunName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskRunInner> beginUpdate( + String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + return this.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 {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskRunInner> beginUpdate( + String resourceGroupName, + String registryName, + String taskRunName, + TaskRunUpdateParameters updateParameters, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDetailsAsync(String resourceGroupName, String registryName, String taskRunName) { + return getDetailsWithResponseAsync(resourceGroupName, registryName, taskRunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDetailsWithResponse( + String resourceGroupName, String registryName, String taskRunName, Context context) { + return getDetailsWithResponseAsync(resourceGroupName, registryName, taskRunName, 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) + public TaskRunInner getDetails(String resourceGroupName, String registryName, String taskRunName) { + return getDetailsWithResponse(resourceGroupName, registryName, taskRunName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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..6bc1c288d97c5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TaskRunsImpl.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.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; + +public final class TaskRunsImpl implements TaskRuns { + private static 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 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 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 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 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 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 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..5e696188846dc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TasksClientImpl.java @@ -0,0 +1,1608 @@ +// Copyright (c) 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.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 { + /** 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") + public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String taskName) { + return getWithResponseAsync(resourceGroupName, registryName, taskName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String taskName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, taskName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getWithResponse(resourceGroupName, registryName, taskName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskInner> beginCreate( + String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return this.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 {@link SyncPoller} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskInner> beginCreate( + String resourceGroupName, + String registryName, + String taskName, + TaskInner taskCreateParameters, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String taskName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String taskName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskInner> beginUpdate( + String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return this.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 {@link SyncPoller} for polling of the task that has the ARM resource and task properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskInner> beginUpdate( + String resourceGroupName, + String registryName, + String taskName, + TaskUpdateParameters taskUpdateParameters, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDetailsAsync(String resourceGroupName, String registryName, String taskName) { + return getDetailsWithResponseAsync(resourceGroupName, registryName, taskName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDetailsWithResponse( + String resourceGroupName, String registryName, String taskName, Context context) { + return getDetailsWithResponseAsync(resourceGroupName, registryName, taskName, 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) + public TaskInner getDetails(String resourceGroupName, String registryName, String taskName) { + return getDetailsWithResponse(resourceGroupName, registryName, taskName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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..705eaddfbed90 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TasksImpl.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.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; + +public final class TasksImpl implements Tasks { + private static 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 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 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 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 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 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 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..2816c9108f574 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokenImpl.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.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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..4198ed0060465 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensClientImpl.java @@ -0,0 +1,1443 @@ +// Copyright (c) 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.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 { + /** 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") + public interface TokensService { + @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( + "/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({"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, + @HeaderParam("Accept") String accept, + 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("{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 tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String tokenName) { + return getWithResponseAsync(resourceGroupName, registryName, tokenName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String tokenName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, tokenName, context).block(); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getWithResponse(resourceGroupName, registryName, tokenName, Context.NONE).getValue(); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TokenInner> beginCreate( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return this.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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TokenInner> beginCreate( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + return this + .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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + accept, + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + accept, + context); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String tokenName) { + return this.beginDeleteAsync(resourceGroupName, registryName, tokenName).getSyncPoller(); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String tokenName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, tokenName, context).getSyncPoller(); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TokenInner> beginUpdate( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return this.beginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).getSyncPoller(); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TokenInner> beginUpdate( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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..06d05b952e8d6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) 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; + +public final class TokensImpl implements Tokens { + private static 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 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 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 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 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 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..bbc25e6a9d5c1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhookImpl.java @@ -0,0 +1,295 @@ +// Copyright (c) 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 Response pingWithResponse(Context context) { + return serviceManager.webhooks().pingWithResponse(resourceGroupName, registryName, webhookName, context); + } + + public EventInfo ping() { + return serviceManager.webhooks().ping(resourceGroupName, registryName, webhookName); + } + + public PagedIterable listEvents() { + return serviceManager.webhooks().listEvents(resourceGroupName, registryName, webhookName); + } + + public PagedIterable listEvents(Context context) { + return serviceManager.webhooks().listEvents(resourceGroupName, registryName, webhookName, context); + } + + public Response getCallbackConfigWithResponse(Context context) { + return serviceManager + .webhooks() + .getCallbackConfigWithResponse(resourceGroupName, registryName, webhookName, context); + } + + public CallbackConfig getCallbackConfig() { + return serviceManager.webhooks().getCallbackConfig(resourceGroupName, registryName, webhookName); + } + + 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..46e270bdfe114 --- /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.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 { + /** 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") + public interface WebhooksService { + @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"}) + @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"}) + @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}/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"}) + @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"}) + @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); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String webhookName) { + return getWithResponseAsync(resourceGroupName, registryName, webhookName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getWithResponse(resourceGroupName, registryName, webhookName, Context.NONE).getValue(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebhookInner> beginCreate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + return this + .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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebhookInner> beginCreate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + return this + .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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String webhookName) { + return this.beginDeleteAsync(resourceGroupName, registryName, webhookName).getSyncPoller(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String webhookName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, webhookName, context).getSyncPoller(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebhookInner> beginUpdate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + return this + .beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters) + .getSyncPoller(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebhookInner> beginUpdate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pingAsync(String resourceGroupName, String registryName, String webhookName) { + return pingWithResponseAsync(resourceGroupName, registryName, webhookName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + return pingWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 pingWithResponse(resourceGroupName, registryName, webhookName, Context.NONE).getValue(); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listEvents( + String resourceGroupName, String registryName, String webhookName, Context context) { + return new PagedIterable<>(listEventsAsync(resourceGroupName, registryName, webhookName, context)); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-11-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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCallbackConfigAsync( + String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithResponseAsync(resourceGroupName, registryName, webhookName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCallbackConfigWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + return getCallbackConfigWithResponseAsync(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. The name is case insensitive. + * @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 getCallbackConfigWithResponse(resourceGroupName, registryName, webhookName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..18f4b408cb951 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksImpl.java @@ -0,0 +1,255 @@ +// Copyright (c) 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; + +public final class WebhooksImpl implements Webhooks { + private static 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 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 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 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 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 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 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 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 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 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 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..1e99c436fd63b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Action.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The action of IP ACL rule. */ +public final class Action extends ExpandableStringEnum { + /** Static value Allow for Action. */ + public static final Action ALLOW = fromString("Allow"); + + /** + * Creates a new instance of Action value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Action() { + } + + /** + * 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); + } + + /** + * Gets known Action values. + * + * @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..b5a5506b646c9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActionsRequired.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** A message indicating if changes on the service provider require any updates on the consumer. */ +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 a new instance of ActionsRequired value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionsRequired() { + } + + /** + * 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); + } + + /** + * Gets known ActionsRequired values. + * + * @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..b39dd4ae4e7ba --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The activation properties of the connected registry. */ +@Immutable +public final class ActivationProperties { + /* + * The activation status of the connected registry. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ActivationStatus status; + + /** Creates an instance of ActivationProperties class. */ + public ActivationProperties() { + } + + /** + * 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..0d6cff535b9d4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The activation status of the connected registry. */ +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 a new instance of ActivationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActivationStatus() { + } + + /** + * 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); + } + + /** + * Gets known ActivationStatus values. + * + * @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..90e5fa087789b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Actor.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.annotation.Fluent; +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 { + /* + * The subject or username associated with the request context that generated the event. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of Actor class. */ + public Actor() { + } + + /** + * 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..d9ee69caa7c47 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPool.java @@ -0,0 +1,333 @@ +// Copyright (c) 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. + * + * @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 along with {@link Response}. + */ + Response getQueueStatusWithResponse(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(); +} 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..5967524c6e289 --- /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.resourcemanager.containerregistry.generated.fluent.models.AgentPoolInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The collection of agent pools. */ +@Fluent +public final class AgentPoolListResult { + /* + * 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; + + /** Creates an instance of AgentPoolListResult class. */ + public AgentPoolListResult() { + } + + /** + * 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..6494568c84cc0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AgentPoolUpdateParameters.java @@ -0,0 +1,95 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.fluent.models.AgentPoolPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating an agent pool. */ +@Fluent +public final class AgentPoolUpdateParameters { + /* + * The properties associated with the agent pool + */ + @JsonProperty(value = "properties") + private AgentPoolPropertiesUpdateParameters innerProperties; + + /* + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of AgentPoolUpdateParameters class. */ + public AgentPoolUpdateParameters() { + } + + /** + * Get the innerProperties property: The properties associated with the agent pool. + * + * @return the innerProperties value. + */ + private AgentPoolPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolPropertiesUpdateParameters(); + } + this.innerProperties().withCount(count); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..401794460dce0 --- /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. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String agentPoolName, 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 com.azure.core.management.exception.ManagementException 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getQueueStatusWithResponse( + String resourceGroupName, String registryName, String agentPoolName, 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 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..4784870e82e71 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that determine the run agent configuration. */ +@Fluent +public final class AgentProperties { + /* + * The CPU configuration in terms of number of cores required for the run. + */ + @JsonProperty(value = "cpu") + private Integer cpu; + + /** Creates an instance of AgentProperties class. */ + public AgentProperties() { + } + + /** + * 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..22f017a9e288b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Architecture.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The OS 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 a new instance of Architecture value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Architecture() { + } + + /** + * 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); + } + + /** + * Gets known Architecture values. + * + * @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/Archive.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Archive.java new file mode 100644 index 0000000000000..bbf5cdb846ca4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Archive.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ArchiveInner; + +/** An immutable client-side representation of Archive. */ +public interface Archive { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the packageSource property: The package source of the archive. + * + * @return the packageSource value. + */ + ArchivePackageSourceProperties packageSource(); + + /** + * Gets the publishedVersion property: The published version of the archive. + * + * @return the publishedVersion value. + */ + String publishedVersion(); + + /** + * Gets the repositoryEndpointPrefix property: The repositoryEndpointPrefix property. + * + * @return the repositoryEndpointPrefix value. + */ + String repositoryEndpointPrefix(); + + /** + * Gets the repositoryEndpoint property: The repositoryEndpoint property. + * + * @return the repositoryEndpoint value. + */ + String repositoryEndpoint(); + + /** + * Gets the provisioningState property: The provisioning state of the archive at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ArchiveInner object. + * + * @return the inner object. + */ + ArchiveInner innerModel(); + + /** The entirety of the Archive definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The Archive definition stages. */ + interface DefinitionStages { + /** The first stage of the Archive definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the Archive definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName, packageType. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @return the next definition stage. + */ + WithCreate withExistingPackage(String resourceGroupName, String registryName, String packageType); + } + + /** + * The stage of the Archive 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.WithPackageSource, + DefinitionStages.WithPublishedVersion, + DefinitionStages.WithRepositoryEndpointPrefix { + /** + * Executes the create request. + * + * @return the created resource. + */ + Archive create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Archive create(Context context); + } + + /** The stage of the Archive definition allowing to specify packageSource. */ + interface WithPackageSource { + /** + * Specifies the packageSource property: The package source of the archive.. + * + * @param packageSource The package source of the archive. + * @return the next definition stage. + */ + WithCreate withPackageSource(ArchivePackageSourceProperties packageSource); + } + + /** The stage of the Archive definition allowing to specify publishedVersion. */ + interface WithPublishedVersion { + /** + * Specifies the publishedVersion property: The published version of the archive.. + * + * @param publishedVersion The published version of the archive. + * @return the next definition stage. + */ + WithCreate withPublishedVersion(String publishedVersion); + } + + /** The stage of the Archive definition allowing to specify repositoryEndpointPrefix. */ + interface WithRepositoryEndpointPrefix { + /** + * Specifies the repositoryEndpointPrefix property: The repositoryEndpointPrefix property.. + * + * @param repositoryEndpointPrefix The repositoryEndpointPrefix property. + * @return the next definition stage. + */ + WithCreate withRepositoryEndpointPrefix(String repositoryEndpointPrefix); + } + } + + /** + * Begins update for the Archive resource. + * + * @return the stage of resource update. + */ + Archive.Update update(); + + /** The template for Archive update. */ + interface Update extends UpdateStages.WithPublishedVersion { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Archive apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Archive apply(Context context); + } + + /** The Archive update stages. */ + interface UpdateStages { + /** The stage of the Archive update allowing to specify publishedVersion. */ + interface WithPublishedVersion { + /** + * Specifies the publishedVersion property: The published version of the archive.. + * + * @param publishedVersion The published version of the archive. + * @return the next definition stage. + */ + Update withPublishedVersion(String publishedVersion); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Archive refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Archive refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveListResult.java new file mode 100644 index 0000000000000..673fa6df7f125 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveListResult.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.resourcemanager.containerregistry.generated.fluent.models.ArchiveInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list archives for a container registry. */ +@Fluent +public final class ArchiveListResult { + /* + * The list of archives. Since this list may be incomplete, the nextLink field should be used to request the next + * list of distributions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of archives. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ArchiveListResult class. */ + public ArchiveListResult() { + } + + /** + * Get the value property: The list of archives. Since this list may be incomplete, the nextLink field should be + * used to request the next list of distributions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of archives. Since this list may be incomplete, the nextLink field should be + * used to request the next list of distributions. + * + * @param value the value value to set. + * @return the ArchiveListResult object itself. + */ + public ArchiveListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of archives. + * + * @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 archives. + * + * @param nextLink the nextLink value to set. + * @return the ArchiveListResult object itself. + */ + public ArchiveListResult 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/ArchivePackageSourceProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchivePackageSourceProperties.java new file mode 100644 index 0000000000000..a4c4247d9de4b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchivePackageSourceProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the archive package source. */ +@Fluent +public class ArchivePackageSourceProperties { + /* + * The type of package source for a archive. + */ + @JsonProperty(value = "type") + private PackageSourceType type; + + /* + * The external repository url. + */ + @JsonProperty(value = "url") + private String url; + + /** Creates an instance of ArchivePackageSourceProperties class. */ + public ArchivePackageSourceProperties() { + } + + /** + * Get the type property: The type of package source for a archive. + * + * @return the type value. + */ + public PackageSourceType type() { + return this.type; + } + + /** + * Set the type property: The type of package source for a archive. + * + * @param type the type value to set. + * @return the ArchivePackageSourceProperties object itself. + */ + public ArchivePackageSourceProperties withType(PackageSourceType type) { + this.type = type; + return this; + } + + /** + * Get the url property: The external repository url. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The external repository url. + * + * @param url the url value to set. + * @return the ArchivePackageSourceProperties object itself. + */ + public ArchivePackageSourceProperties withUrl(String url) { + this.url = url; + 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/ArchiveUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveUpdateParameters.java new file mode 100644 index 0000000000000..05f248221e2bb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveUpdateParameters.java @@ -0,0 +1,66 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.fluent.models.ArchiveUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating a archive. */ +@Fluent +public final class ArchiveUpdateParameters { + /* + * The properties of the connected registry update parameters. + */ + @JsonProperty(value = "properties") + private ArchiveUpdateProperties innerProperties; + + /** Creates an instance of ArchiveUpdateParameters class. */ + public ArchiveUpdateParameters() { + } + + /** + * Get the innerProperties property: The properties of the connected registry update parameters. + * + * @return the innerProperties value. + */ + private ArchiveUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the publishedVersion property: The published version of the archive. + * + * @return the publishedVersion value. + */ + public String publishedVersion() { + return this.innerProperties() == null ? null : this.innerProperties().publishedVersion(); + } + + /** + * Set the publishedVersion property: The published version of the archive. + * + * @param publishedVersion the publishedVersion value to set. + * @return the ArchiveUpdateParameters object itself. + */ + public ArchiveUpdateParameters withPublishedVersion(String publishedVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ArchiveUpdateProperties(); + } + this.innerProperties().withPublishedVersion(publishedVersion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersion.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersion.java new file mode 100644 index 0000000000000..0f966388374a8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersion.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.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ArchiveVersionInner; + +/** An immutable client-side representation of ArchiveVersion. */ +public interface ArchiveVersion { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the archive at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the archiveVersionErrorMessage property: The detailed error message for the archive version in the case of + * failure. + * + * @return the archiveVersionErrorMessage value. + */ + String archiveVersionErrorMessage(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ArchiveVersionInner object. + * + * @return the inner object. + */ + ArchiveVersionInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersionListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersionListResult.java new file mode 100644 index 0000000000000..308e348787eff --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersionListResult.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.resourcemanager.containerregistry.generated.fluent.models.ArchiveVersionInner; +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 ArchiveVersionListResult { + /* + * 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; + + /** Creates an instance of ArchiveVersionListResult class. */ + public ArchiveVersionListResult() { + } + + /** + * 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 ArchiveVersionListResult object itself. + */ + public ArchiveVersionListResult 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 ArchiveVersionListResult object itself. + */ + public ArchiveVersionListResult 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/ArchiveVersions.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersions.java new file mode 100644 index 0000000000000..4940d833f0fd3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ArchiveVersions.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 ArchiveVersions. */ +public interface ArchiveVersions { + /** + * Lists all archive versions for the specified container registry, repository type and archive name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String registryName, String packageType, String archiveName); + + /** + * Lists all archive versions for the specified container registry, repository type and archive name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context); + + /** + * Gets the properties of the archive version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @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 archive version along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context); + + /** + * Gets the properties of the archive version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 archive version. + */ + ArchiveVersion get( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName); + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + ArchiveVersion create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName); + + /** + * Creates a archive for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @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. + */ + ArchiveVersion create( + String resourceGroupName, + String registryName, + String packageType, + String archiveName, + String archiveVersionName, + Context context); + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 packageType, + String archiveName, + String archiveVersionName); + + /** + * Deletes a archive version from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @param archiveVersionName The name of the archive version resource. + * @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 packageType, + String archiveName, + String archiveVersionName, + Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Archives.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Archives.java new file mode 100644 index 0000000000000..6a61e326ff9a9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Archives.java @@ -0,0 +1,150 @@ +// Copyright (c) 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 Archives. */ +public interface Archives { + /** + * Lists all archives for the specified container registry and package type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 archives for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String packageType); + + /** + * Lists all archives for the specified container registry and package type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @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 archives for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String packageType, Context context); + + /** + * Gets the properties of the archive. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @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 archive along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String packageType, String archiveName, Context context); + + /** + * Gets the properties of the archive. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 archive. + */ + Archive get(String resourceGroupName, String registryName, String packageType, String archiveName); + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 packageType, String archiveName); + + /** + * Deletes a archive from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param packageType The type of the package resource. + * @param archiveName The name of the archive resource. + * @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 packageType, String archiveName, Context context); + + /** + * Gets the properties of the archive. + * + * @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 archive along with {@link Response}. + */ + Archive getById(String id); + + /** + * Gets the properties of the archive. + * + * @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 archive along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a archive 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 archive 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 Archive resource. + * + * @param name resource name. + * @return the first stage of the new Archive definition. + */ + Archive.DefinitionStages.Blank define(String name); +} 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..1d87b78b8f676 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Argument.java @@ -0,0 +1,115 @@ +// Copyright (c) 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.JsonProperty; + +/** The properties of a run argument. */ +@Fluent +public final class Argument { + /* + * The name of the argument. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The value of the argument. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /* + * Flag to indicate whether the argument represents a secret and want to be removed from build logs. + */ + @JsonProperty(value = "isSecret") + private Boolean isSecret; + + /** Creates an instance of Argument class. */ + public Argument() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Argument.class); +} 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..090d418b1c2ca --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuditLogStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates whether audit logs are enabled on the connected registry. */ +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 a new instance of AuditLogStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuditLogStatus() { + } + + /** + * 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); + } + + /** + * Gets known AuditLogStatus values. + * + * @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/AuthCredential.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthCredential.java new file mode 100644 index 0000000000000..e050c67a3c625 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthCredential.java @@ -0,0 +1,120 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; + +/** Authentication credential stored for an upstream. */ +@Fluent +public final class AuthCredential { + /* + * The name of the credential. + */ + @JsonProperty(value = "name") + private CredentialName name; + + /* + * KeyVault Secret URI for accessing the username. + */ + @JsonProperty(value = "usernameSecretIdentifier") + private String usernameSecretIdentifier; + + /* + * KeyVault Secret URI for accessing the password. + */ + @JsonProperty(value = "passwordSecretIdentifier") + private String passwordSecretIdentifier; + + /* + * This provides data pertaining to the health of the auth credential. + */ + @JsonProperty(value = "credentialHealth", access = JsonProperty.Access.WRITE_ONLY) + private CredentialHealth credentialHealth; + + /** Creates an instance of AuthCredential class. */ + public AuthCredential() { + } + + /** + * Get the name property: The name of the credential. + * + * @return the name value. + */ + public CredentialName name() { + return this.name; + } + + /** + * Set the name property: The name of the credential. + * + * @param name the name value to set. + * @return the AuthCredential object itself. + */ + public AuthCredential withName(CredentialName name) { + this.name = name; + return this; + } + + /** + * Get the usernameSecretIdentifier property: KeyVault Secret URI for accessing the username. + * + * @return the usernameSecretIdentifier value. + */ + public String usernameSecretIdentifier() { + return this.usernameSecretIdentifier; + } + + /** + * Set the usernameSecretIdentifier property: KeyVault Secret URI for accessing the username. + * + * @param usernameSecretIdentifier the usernameSecretIdentifier value to set. + * @return the AuthCredential object itself. + */ + public AuthCredential withUsernameSecretIdentifier(String usernameSecretIdentifier) { + this.usernameSecretIdentifier = usernameSecretIdentifier; + return this; + } + + /** + * Get the passwordSecretIdentifier property: KeyVault Secret URI for accessing the password. + * + * @return the passwordSecretIdentifier value. + */ + public String passwordSecretIdentifier() { + return this.passwordSecretIdentifier; + } + + /** + * Set the passwordSecretIdentifier property: KeyVault Secret URI for accessing the password. + * + * @param passwordSecretIdentifier the passwordSecretIdentifier value to set. + * @return the AuthCredential object itself. + */ + public AuthCredential withPasswordSecretIdentifier(String passwordSecretIdentifier) { + this.passwordSecretIdentifier = passwordSecretIdentifier; + return this; + } + + /** + * Get the credentialHealth property: This provides data pertaining to the health of the auth credential. + * + * @return the credentialHealth value. + */ + public CredentialHealth credentialHealth() { + return this.credentialHealth; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentialHealth() != null) { + credentialHealth().validate(); + } + } +} 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..5c24bf0273814 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuthInfo.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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The authorization properties for accessing the source code repository. */ +@Fluent +public final class AuthInfo { + /* + * 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; + + /** Creates an instance of AuthInfo class. */ + public AuthInfo() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AuthInfo.class); +} 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..89bec38f70ef3 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The authorization properties for accessing the source code repository. */ +@Fluent +public final class AuthInfoUpdateParameters { + /* + * 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; + + /** Creates an instance of AuthInfoUpdateParameters class. */ + public AuthInfoUpdateParameters() { + } + + /** + * 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/AzureADAuthenticationAsArmPolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicy.java new file mode 100644 index 0000000000000..3137887e53a18 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicy.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.fasterxml.jackson.annotation.JsonProperty; + +/** The policy for using ARM audience token for a container registry. */ +@Fluent +public final class AzureADAuthenticationAsArmPolicy { + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private AzureADAuthenticationAsArmPolicyStatus status; + + /** Creates an instance of AzureADAuthenticationAsArmPolicy class. */ + public AzureADAuthenticationAsArmPolicy() { + } + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public AzureADAuthenticationAsArmPolicyStatus 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 AzureADAuthenticationAsArmPolicy object itself. + */ + public AzureADAuthenticationAsArmPolicy withStatus(AzureADAuthenticationAsArmPolicyStatus 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/AzureADAuthenticationAsArmPolicyStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicyStatus.java new file mode 100644 index 0000000000000..144a28af89866 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicyStatus.java @@ -0,0 +1,48 @@ +// Copyright (c) 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; + +/** The value that indicates whether the policy is enabled or not. */ +public final class AzureADAuthenticationAsArmPolicyStatus + extends ExpandableStringEnum { + /** Static value enabled for AzureADAuthenticationAsArmPolicyStatus. */ + public static final AzureADAuthenticationAsArmPolicyStatus ENABLED = fromString("enabled"); + + /** Static value disabled for AzureADAuthenticationAsArmPolicyStatus. */ + public static final AzureADAuthenticationAsArmPolicyStatus DISABLED = fromString("disabled"); + + /** + * Creates a new instance of AzureADAuthenticationAsArmPolicyStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureADAuthenticationAsArmPolicyStatus() { + } + + /** + * Creates or finds a AzureADAuthenticationAsArmPolicyStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureADAuthenticationAsArmPolicyStatus. + */ + @JsonCreator + public static AzureADAuthenticationAsArmPolicyStatus fromString(String name) { + return fromString(name, AzureADAuthenticationAsArmPolicyStatus.class); + } + + /** + * Gets known AzureADAuthenticationAsArmPolicyStatus values. + * + * @return known AzureADAuthenticationAsArmPolicyStatus values. + */ + public static Collection values() { + return values(AzureADAuthenticationAsArmPolicyStatus.class); + } +} 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..e0262a1ded393 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Properties that describe a base image dependency. */ +@Fluent +public final class BaseImageDependency { + /* + * 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; + + /** Creates an instance of BaseImageDependency class. */ + public BaseImageDependency() { + } + + /** + * 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..76b745c3201c4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageDependencyType.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the base image dependency. */ +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 a new instance of BaseImageDependencyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BaseImageDependencyType() { + } + + /** + * 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); + } + + /** + * Gets known BaseImageDependencyType values. + * + * @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..6d8b41f5c13c8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTrigger.java @@ -0,0 +1,168 @@ +// Copyright (c) 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.JsonProperty; + +/** The trigger based on base image dependency. */ +@Fluent +public final class BaseImageTrigger { + /* + * 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; + + /** Creates an instance of BaseImageTrigger class. */ + public BaseImageTrigger() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BaseImageTrigger.class); +} 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..09999dd3e922a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTriggerType.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the auto trigger for base image dependency updates. */ +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 a new instance of BaseImageTriggerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BaseImageTriggerType() { + } + + /** + * 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); + } + + /** + * Gets known BaseImageTriggerType values. + * + * @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..42703e55a5f0d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/BaseImageTriggerUpdateParameters.java @@ -0,0 +1,164 @@ +// Copyright (c) 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.JsonProperty; + +/** The properties for updating base image dependency trigger. */ +@Fluent +public final class BaseImageTriggerUpdateParameters { + /* + * 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; + + /** Creates an instance of BaseImageTriggerUpdateParameters class. */ + public BaseImageTriggerUpdateParameters() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BaseImageTriggerUpdateParameters.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRule.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRule.java new file mode 100644 index 0000000000000..dfc1b726d4b2f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRule.java @@ -0,0 +1,233 @@ +// Copyright (c) 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.CacheRuleInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of CacheRule. */ +public interface CacheRule { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the credentialSetResourceId property: The ARM resource ID of the credential store which is associated with + * the cache rule. + * + * @return the credentialSetResourceId value. + */ + String credentialSetResourceId(); + + /** + * Gets the sourceRepository property: Source repository pulled from upstream. + * + * @return the sourceRepository value. + */ + String sourceRepository(); + + /** + * Gets the targetRepository property: Target repository specified in docker pull command. Eg: docker pull + * myregistry.azurecr.io/{targetRepository}:{tag}. + * + * @return the targetRepository value. + */ + String targetRepository(); + + /** + * Gets the creationDate property: The creation date of the cache rule. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.CacheRuleInner object. + * + * @return the inner object. + */ + CacheRuleInner innerModel(); + + /** The entirety of the CacheRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The CacheRule definition stages. */ + interface DefinitionStages { + /** The first stage of the CacheRule definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the CacheRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the CacheRule 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.WithCredentialSetResourceId, + DefinitionStages.WithSourceRepository, + DefinitionStages.WithTargetRepository { + /** + * Executes the create request. + * + * @return the created resource. + */ + CacheRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CacheRule create(Context context); + } + + /** The stage of the CacheRule definition allowing to specify credentialSetResourceId. */ + interface WithCredentialSetResourceId { + /** + * Specifies the credentialSetResourceId property: The ARM resource ID of the credential store which is + * associated with the cache rule.. + * + * @param credentialSetResourceId The ARM resource ID of the credential store which is associated with the + * cache rule. + * @return the next definition stage. + */ + WithCreate withCredentialSetResourceId(String credentialSetResourceId); + } + + /** The stage of the CacheRule definition allowing to specify sourceRepository. */ + interface WithSourceRepository { + /** + * Specifies the sourceRepository property: Source repository pulled from upstream.. + * + * @param sourceRepository Source repository pulled from upstream. + * @return the next definition stage. + */ + WithCreate withSourceRepository(String sourceRepository); + } + + /** The stage of the CacheRule definition allowing to specify targetRepository. */ + interface WithTargetRepository { + /** + * Specifies the targetRepository property: Target repository specified in docker pull command. Eg: docker + * pull myregistry.azurecr.io/{targetRepository}:{tag}. + * + * @param targetRepository Target repository specified in docker pull command. Eg: docker pull + * myregistry.azurecr.io/{targetRepository}:{tag}. + * @return the next definition stage. + */ + WithCreate withTargetRepository(String targetRepository); + } + } + + /** + * Begins update for the CacheRule resource. + * + * @return the stage of resource update. + */ + CacheRule.Update update(); + + /** The template for CacheRule update. */ + interface Update extends UpdateStages.WithCredentialSetResourceId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CacheRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CacheRule apply(Context context); + } + + /** The CacheRule update stages. */ + interface UpdateStages { + /** The stage of the CacheRule update allowing to specify credentialSetResourceId. */ + interface WithCredentialSetResourceId { + /** + * Specifies the credentialSetResourceId property: The ARM resource ID of the credential store which is + * associated with the Cache rule.. + * + * @param credentialSetResourceId The ARM resource ID of the credential store which is associated with the + * Cache rule. + * @return the next definition stage. + */ + Update withCredentialSetResourceId(String credentialSetResourceId); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CacheRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CacheRule refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRuleUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRuleUpdateParameters.java new file mode 100644 index 0000000000000..29b6569fbfec6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRuleUpdateParameters.java @@ -0,0 +1,68 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.fluent.models.CacheRuleUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating a cache rule. */ +@Fluent +public final class CacheRuleUpdateParameters { + /* + * The properties of the cache rule update parameters. + */ + @JsonProperty(value = "properties") + private CacheRuleUpdateProperties innerProperties; + + /** Creates an instance of CacheRuleUpdateParameters class. */ + public CacheRuleUpdateParameters() { + } + + /** + * Get the innerProperties property: The properties of the cache rule update parameters. + * + * @return the innerProperties value. + */ + private CacheRuleUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the credentialSetResourceId property: The ARM resource ID of the credential store which is associated with + * the Cache rule. + * + * @return the credentialSetResourceId value. + */ + public String credentialSetResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().credentialSetResourceId(); + } + + /** + * Set the credentialSetResourceId property: The ARM resource ID of the credential store which is associated with + * the Cache rule. + * + * @param credentialSetResourceId the credentialSetResourceId value to set. + * @return the CacheRuleUpdateParameters object itself. + */ + public CacheRuleUpdateParameters withCredentialSetResourceId(String credentialSetResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new CacheRuleUpdateProperties(); + } + this.innerProperties().withCredentialSetResourceId(credentialSetResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRules.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRules.java new file mode 100644 index 0000000000000..88a168206b6f6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRules.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.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 CacheRules. */ +public interface CacheRules { + /** + * Lists all cache rule resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 cache rules for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all cache rule resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 cache rules for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified cache rule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @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 cache rule resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String cacheRuleName, Context context); + + /** + * Gets the properties of the specified cache rule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cache rule resource. + */ + CacheRule get(String resourceGroupName, String registryName, String cacheRuleName); + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cacheRuleName); + + /** + * Deletes a cache rule resource from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @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 cacheRuleName, Context context); + + /** + * Gets the properties of the specified cache rule 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. + * @return the properties of the specified cache rule resource along with {@link Response}. + */ + CacheRule getById(String id); + + /** + * Gets the properties of the specified cache rule 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. + * @return the properties of the specified cache rule resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a cache rule resource 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 cache rule resource 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 CacheRule resource. + * + * @param name resource name. + * @return the first stage of the new CacheRule definition. + */ + CacheRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRulesListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRulesListResult.java new file mode 100644 index 0000000000000..4df6613214e07 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CacheRulesListResult.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.resourcemanager.containerregistry.generated.fluent.models.CacheRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list cache rules for a container registry. */ +@Fluent +public final class CacheRulesListResult { + /* + * The list of cache rules. + */ + @JsonProperty(value = "value") + private List value; + + /* + * If provided, client must use NextLink URI to request next list of cache rules. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CacheRulesListResult class. */ + public CacheRulesListResult() { + } + + /** + * Get the value property: The list of cache rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of cache rules. + * + * @param value the value value to set. + * @return the CacheRulesListResult object itself. + */ + public CacheRulesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: If provided, client must use NextLink URI to request next list of cache rules. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: If provided, client must use NextLink URI to request next list of cache rules. + * + * @param nextLink the nextLink value to set. + * @return the CacheRulesListResult object itself. + */ + public CacheRulesListResult 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/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..f5552369342e1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CertificateType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of certificate location. */ +public final class CertificateType extends ExpandableStringEnum { + /** Static value LocalDirectory for CertificateType. */ + public static final CertificateType LOCAL_DIRECTORY = fromString("LocalDirectory"); + + /** + * Creates a new instance of CertificateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CertificateType() { + } + + /** + * 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); + } + + /** + * Gets known CertificateType values. + * + * @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..fa253af2f7d56 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistries.java @@ -0,0 +1,173 @@ +// Copyright (c) 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 { + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context); + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..dfbe29af2503b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistry.java @@ -0,0 +1,376 @@ +// Copyright (c) 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @return the notificationsList value. + */ + List notificationsList(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. The name is case insensitive. + * @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, + DefinitionStages.WithNotificationsList { + /** + * 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); + } + + /** The stage of the ConnectedRegistry definition allowing to specify notificationsList. */ + interface WithNotificationsList { + /** + * Specifies the notificationsList property: The list of notifications subscription information for the + * connected registry.. + * + * @param notificationsList The list of notifications subscription information for the connected registry. + * @return the next definition stage. + */ + WithCreate withNotificationsList(List notificationsList); + } + } + + /** + * 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, + UpdateStages.WithNotificationsList { + /** + * 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); + } + + /** The stage of the ConnectedRegistry update allowing to specify notificationsList. */ + interface WithNotificationsList { + /** + * Specifies the notificationsList property: The list of notifications subscription information for the + * connected registry.. + * + * @param notificationsList The list of notifications subscription information for the connected registry. + * @return the next definition stage. + */ + Update withNotificationsList(List notificationsList); + } + } + + /** + * 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..4d5293ca285cf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryListResult.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.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +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 { + /* + * 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; + + /** Creates an instance of ConnectedRegistryListResult class. */ + public ConnectedRegistryListResult() { + } + + /** + * 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..e75c4d9f98275 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryMode.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The mode of the connected registry resource that indicates the permissions of the registry. */ +public final class ConnectedRegistryMode extends ExpandableStringEnum { + /** Static value ReadWrite for ConnectedRegistryMode. */ + public static final ConnectedRegistryMode READ_WRITE = fromString("ReadWrite"); + + /** Static value ReadOnly for ConnectedRegistryMode. */ + public static final ConnectedRegistryMode READ_ONLY = fromString("ReadOnly"); + + /** 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 a new instance of ConnectedRegistryMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectedRegistryMode() { + } + + /** + * 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); + } + + /** + * Gets known ConnectedRegistryMode values. + * + * @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..0b44114d3b71d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryUpdateParameters.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.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The parameters for updating a connected registry. */ +@Fluent +public final class ConnectedRegistryUpdateParameters { + /* + * The properties of the connected registry update parameters. + */ + @JsonProperty(value = "properties") + private ConnectedRegistryUpdateProperties innerProperties; + + /** Creates an instance of ConnectedRegistryUpdateParameters class. */ + public ConnectedRegistryUpdateParameters() { + } + + /** + * Get the innerProperties property: The properties of the connected registry update parameters. + * + * @return the innerProperties value. + */ + private ConnectedRegistryUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the syncProperties property: The sync properties of the connected registry with its parent. + * + * @return the syncProperties value. + */ + public SyncUpdateProperties syncProperties() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryUpdateProperties(); + } + this.innerProperties().withSyncProperties(syncProperties); + return this; + } + + /** + * Get the logging property: The logging properties of the connected registry. + * + * @return the logging value. + */ + public LoggingProperties logging() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryUpdateProperties(); + } + this.innerProperties().withLogging(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryUpdateProperties(); + } + this.innerProperties().withClientTokenIds(clientTokenIds); + return this; + } + + /** + * Get the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @return the notificationsList value. + */ + public List notificationsList() { + return this.innerProperties() == null ? null : this.innerProperties().notificationsList(); + } + + /** + * Set the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @param notificationsList the notificationsList value to set. + * @return the ConnectedRegistryUpdateParameters object itself. + */ + public ConnectedRegistryUpdateParameters withNotificationsList(List notificationsList) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryUpdateProperties(); + } + this.innerProperties().withNotificationsList(notificationsList); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..1840ca5278df4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current connection state of the connected registry. */ +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 a new instance of ConnectionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionState() { + } + + /** + * 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); + } + + /** + * Gets known ConnectionState values. + * + * @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..6363ef0c9b6c8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionStatus.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The private link service connection status. */ +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 a new instance of ConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionStatus() { + } + + /** + * 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); + } + + /** + * Gets known ConnectionStatus values. + * + * @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/CredentialHealth.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialHealth.java new file mode 100644 index 0000000000000..ed13de7f3de41 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialHealth.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.fasterxml.jackson.annotation.JsonProperty; + +/** The health of the auth credential. */ +@Fluent +public final class CredentialHealth { + /* + * The health status of credential. + */ + @JsonProperty(value = "status") + private CredentialHealthStatus status; + + /* + * Error code representing the health check error. + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Descriptive message representing the health check error. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** Creates an instance of CredentialHealth class. */ + public CredentialHealth() { + } + + /** + * Get the status property: The health status of credential. + * + * @return the status value. + */ + public CredentialHealthStatus status() { + return this.status; + } + + /** + * Set the status property: The health status of credential. + * + * @param status the status value to set. + * @return the CredentialHealth object itself. + */ + public CredentialHealth withStatus(CredentialHealthStatus status) { + this.status = status; + return this; + } + + /** + * Get the errorCode property: Error code representing the health check error. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: Error code representing the health check error. + * + * @param errorCode the errorCode value to set. + * @return the CredentialHealth object itself. + */ + public CredentialHealth withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Descriptive message representing the health check error. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Descriptive message representing the health check error. + * + * @param errorMessage the errorMessage value to set. + * @return the CredentialHealth object itself. + */ + public CredentialHealth withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + 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/CredentialHealthStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialHealthStatus.java new file mode 100644 index 0000000000000..cfecebd374a19 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialHealthStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The health status of credential. */ +public final class CredentialHealthStatus extends ExpandableStringEnum { + /** Static value Healthy for CredentialHealthStatus. */ + public static final CredentialHealthStatus HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for CredentialHealthStatus. */ + public static final CredentialHealthStatus UNHEALTHY = fromString("Unhealthy"); + + /** + * Creates a new instance of CredentialHealthStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CredentialHealthStatus() { + } + + /** + * Creates or finds a CredentialHealthStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CredentialHealthStatus. + */ + @JsonCreator + public static CredentialHealthStatus fromString(String name) { + return fromString(name, CredentialHealthStatus.class); + } + + /** + * Gets known CredentialHealthStatus values. + * + * @return known CredentialHealthStatus values. + */ + public static Collection values() { + return values(CredentialHealthStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialName.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialName.java new file mode 100644 index 0000000000000..fb1219e69a001 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialName.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The name of the credential. */ +public final class CredentialName extends ExpandableStringEnum { + /** Static value Credential1 for CredentialName. */ + public static final CredentialName CREDENTIAL1 = fromString("Credential1"); + + /** + * Creates a new instance of CredentialName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CredentialName() { + } + + /** + * Creates or finds a CredentialName from its string representation. + * + * @param name a name to look for. + * @return the corresponding CredentialName. + */ + @JsonCreator + public static CredentialName fromString(String name) { + return fromString(name, CredentialName.class); + } + + /** + * Gets known CredentialName values. + * + * @return known CredentialName values. + */ + public static Collection values() { + return values(CredentialName.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSet.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSet.java new file mode 100644 index 0000000000000..ff554cab3be17 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSet.java @@ -0,0 +1,244 @@ +// Copyright (c) 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.CredentialSetInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of CredentialSet. */ +public interface CredentialSet { + /** + * 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: Identities associated with the resource. This is used to access the KeyVault secrets. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the loginServer property: The credentials are stored for this upstream or login server. + * + * @return the loginServer value. + */ + String loginServer(); + + /** + * Gets the authCredentials property: List of authentication credentials stored for an upstream. Usually consists of + * a primary and an optional secondary credential. + * + * @return the authCredentials value. + */ + List authCredentials(); + + /** + * Gets the creationDate property: The creation date of credential store resource. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.CredentialSetInner object. + * + * @return the inner object. + */ + CredentialSetInner innerModel(); + + /** The entirety of the CredentialSet definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The CredentialSet definition stages. */ + interface DefinitionStages { + /** The first stage of the CredentialSet definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the CredentialSet definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the CredentialSet 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.WithIdentity, + DefinitionStages.WithLoginServer, + DefinitionStages.WithAuthCredentials { + /** + * Executes the create request. + * + * @return the created resource. + */ + CredentialSet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CredentialSet create(Context context); + } + + /** The stage of the CredentialSet definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identities associated with the resource. This is used to access the + * KeyVault secrets.. + * + * @param identity Identities associated with the resource. This is used to access the KeyVault secrets. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + + /** The stage of the CredentialSet definition allowing to specify loginServer. */ + interface WithLoginServer { + /** + * Specifies the loginServer property: The credentials are stored for this upstream or login server.. + * + * @param loginServer The credentials are stored for this upstream or login server. + * @return the next definition stage. + */ + WithCreate withLoginServer(String loginServer); + } + + /** The stage of the CredentialSet definition allowing to specify authCredentials. */ + interface WithAuthCredentials { + /** + * Specifies the authCredentials property: List of authentication credentials stored for an upstream. + * Usually consists of a primary and an optional secondary credential.. + * + * @param authCredentials List of authentication credentials stored for an upstream. Usually consists of a + * primary and an optional secondary credential. + * @return the next definition stage. + */ + WithCreate withAuthCredentials(List authCredentials); + } + } + + /** + * Begins update for the CredentialSet resource. + * + * @return the stage of resource update. + */ + CredentialSet.Update update(); + + /** The template for CredentialSet update. */ + interface Update extends UpdateStages.WithIdentity, UpdateStages.WithAuthCredentials { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CredentialSet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CredentialSet apply(Context context); + } + + /** The CredentialSet update stages. */ + interface UpdateStages { + /** The stage of the CredentialSet update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identities associated with the resource. This is used to access the + * KeyVault secrets.. + * + * @param identity Identities associated with the resource. This is used to access the KeyVault secrets. + * @return the next definition stage. + */ + Update withIdentity(IdentityProperties identity); + } + + /** The stage of the CredentialSet update allowing to specify authCredentials. */ + interface WithAuthCredentials { + /** + * Specifies the authCredentials property: List of authentication credentials stored for an upstream. + * Usually consists of a primary and an optional secondary credential.. + * + * @param authCredentials List of authentication credentials stored for an upstream. Usually consists of a + * primary and an optional secondary credential. + * @return the next definition stage. + */ + Update withAuthCredentials(List authCredentials); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CredentialSet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CredentialSet refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSetListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSetListResult.java new file mode 100644 index 0000000000000..8c47242264627 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSetListResult.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.resourcemanager.containerregistry.generated.fluent.models.CredentialSetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list credential sets for a container registry. */ +@Fluent +public final class CredentialSetListResult { + /* + * The list of credential sets. Since this list may be incomplete, the nextLink field should be used to request the + * next list of credential sets. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of credential sets. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CredentialSetListResult class. */ + public CredentialSetListResult() { + } + + /** + * Get the value property: The list of credential sets. Since this list may be incomplete, the nextLink field should + * be used to request the next list of credential sets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of credential sets. Since this list may be incomplete, the nextLink field should + * be used to request the next list of credential sets. + * + * @param value the value value to set. + * @return the CredentialSetListResult object itself. + */ + public CredentialSetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of credential sets. + * + * @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 credential sets. + * + * @param nextLink the nextLink value to set. + * @return the CredentialSetListResult object itself. + */ + public CredentialSetListResult 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/CredentialSetUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSetUpdateParameters.java new file mode 100644 index 0000000000000..249ed139ce798 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSetUpdateParameters.java @@ -0,0 +1,98 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.fluent.models.CredentialSetUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The parameters for updating a credential set. */ +@Fluent +public final class CredentialSetUpdateParameters { + /* + * The properties of the credential set update parameters + */ + @JsonProperty(value = "properties") + private CredentialSetUpdateProperties innerProperties; + + /* + * Identities associated with the resource. This is used to access the KeyVault secrets. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /** Creates an instance of CredentialSetUpdateParameters class. */ + public CredentialSetUpdateParameters() { + } + + /** + * Get the innerProperties property: The properties of the credential set update parameters. + * + * @return the innerProperties value. + */ + private CredentialSetUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: Identities associated with the resource. This is used to access the KeyVault secrets. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: Identities associated with the resource. This is used to access the KeyVault secrets. + * + * @param identity the identity value to set. + * @return the CredentialSetUpdateParameters object itself. + */ + public CredentialSetUpdateParameters withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the authCredentials property: List of authentication credentials stored for an upstream. Usually consists of + * a primary and an optional secondary credential. + * + * @return the authCredentials value. + */ + public List authCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().authCredentials(); + } + + /** + * Set the authCredentials property: List of authentication credentials stored for an upstream. Usually consists of + * a primary and an optional secondary credential. + * + * @param authCredentials the authCredentials value to set. + * @return the CredentialSetUpdateParameters object itself. + */ + public CredentialSetUpdateParameters withAuthCredentials(List authCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new CredentialSetUpdateProperties(); + } + this.innerProperties().withAuthCredentials(authCredentials); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSets.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSets.java new file mode 100644 index 0000000000000..28c65dfd35cfe --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CredentialSets.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.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 CredentialSets. */ +public interface CredentialSets { + /** + * Lists all credential set resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 credential sets for a container registry as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all credential set resources for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 credential sets for a container registry as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified credential set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @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 credential set resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String credentialSetName, Context context); + + /** + * Gets the properties of the specified credential set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 credential set resource. + */ + CredentialSet get(String resourceGroupName, String registryName, String credentialSetName); + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 credentialSetName); + + /** + * Deletes a credential set from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @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 credentialSetName, Context context); + + /** + * Gets the properties of the specified credential set 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. + * @return the properties of the specified credential set resource along with {@link Response}. + */ + CredentialSet getById(String id); + + /** + * Gets the properties of the specified credential set 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. + * @return the properties of the specified credential set resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a credential set 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 credential set 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 CredentialSet resource. + * + * @param name resource name. + * @return the first stage of the new CredentialSet definition. + */ + CredentialSet.DefinitionStages.Blank define(String name); +} 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..29607552914c7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Credentials.java @@ -0,0 +1,98 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonInclude; +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 { + /* + * 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") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customRegistries; + + /** Creates an instance of Credentials class. */ + public Credentials() { + } + + /** + * 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..a724dabedde2b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CustomRegistryCredentials.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.models; + +import com.azure.core.annotation.Fluent; +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 { + /* + * 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; + + /** Creates an instance of CustomRegistryCredentials class. */ + public CustomRegistryCredentials() { + } + + /** + * 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/DebianArchivePackageSourceProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DebianArchivePackageSourceProperties.java new file mode 100644 index 0000000000000..372fdd03c5814 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DebianArchivePackageSourceProperties.java @@ -0,0 +1,66 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the archive package source. */ +@Fluent +public final class DebianArchivePackageSourceProperties extends ArchivePackageSourceProperties { + /* + * Upstream Debian distribution Name. + */ + @JsonProperty(value = "distributionName") + private String distributionName; + + /** Creates an instance of DebianArchivePackageSourceProperties class. */ + public DebianArchivePackageSourceProperties() { + } + + /** + * Get the distributionName property: Upstream Debian distribution Name. + * + * @return the distributionName value. + */ + public String distributionName() { + return this.distributionName; + } + + /** + * Set the distributionName property: Upstream Debian distribution Name. + * + * @param distributionName the distributionName value to set. + * @return the DebianArchivePackageSourceProperties object itself. + */ + public DebianArchivePackageSourceProperties withDistributionName(String distributionName) { + this.distributionName = distributionName; + return this; + } + + /** {@inheritDoc} */ + @Override + public DebianArchivePackageSourceProperties withType(PackageSourceType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public DebianArchivePackageSourceProperties withUrl(String url) { + super.withUrl(url); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DebianArchiveProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DebianArchiveProperties.java new file mode 100644 index 0000000000000..e94caec7bf412 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DebianArchiveProperties.java @@ -0,0 +1,74 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.fluent.models.ArchiveProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the Debian package Archive. */ +@Fluent +public final class DebianArchiveProperties extends ArchiveProperties { + /* + * Debian distribution Name. + */ + @JsonProperty(value = "distributionName") + private String distributionName; + + /** Creates an instance of DebianArchiveProperties class. */ + public DebianArchiveProperties() { + } + + /** + * Get the distributionName property: Debian distribution Name. + * + * @return the distributionName value. + */ + public String distributionName() { + return this.distributionName; + } + + /** + * Set the distributionName property: Debian distribution Name. + * + * @param distributionName the distributionName value to set. + * @return the DebianArchiveProperties object itself. + */ + public DebianArchiveProperties withDistributionName(String distributionName) { + this.distributionName = distributionName; + return this; + } + + /** {@inheritDoc} */ + @Override + public DebianArchiveProperties withPackageSource(ArchivePackageSourceProperties packageSource) { + super.withPackageSource(packageSource); + return this; + } + + /** {@inheritDoc} */ + @Override + public DebianArchiveProperties withPublishedVersion(String publishedVersion) { + super.withPublishedVersion(publishedVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public DebianArchiveProperties withRepositoryEndpointPrefix(String repositoryEndpointPrefix) { + super.withRepositoryEndpointPrefix(repositoryEndpointPrefix); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.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..0fb23310344e3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DefaultAction.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The default action of allow or deny when no other rules match. */ +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 a new instance of DefaultAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultAction() { + } + + /** + * 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); + } + + /** + * Gets known DefaultAction values. + * + * @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..65963958fc343 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerBuildRequest.java @@ -0,0 +1,372 @@ +// Copyright (c) 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.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 { + /* + * 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; + + /** Creates an instance of DockerBuildRequest class. */ + public DockerBuildRequest() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DockerBuildRequest.class); +} 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..44daff61f14eb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DockerBuildStepUpdateParameters.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.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 { + /* + * 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; + + /** Creates an instance of DockerBuildStepUpdateParameters class. */ + public DockerBuildStepUpdateParameters() { + } + + /** + * 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..600cab23112f5 --- /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.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 { + /* + * 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; + + /** Creates an instance of DockerTaskStep class. */ + public DockerTaskStep() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DockerTaskStep.class); +} 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..a634a6c9f9989 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskRunRequest.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.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 { + /* + * 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; + + /** Creates an instance of EncodedTaskRunRequest class. */ + public EncodedTaskRunRequest() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EncodedTaskRunRequest.class); +} 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..76d87cd643fbe --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskStep.java @@ -0,0 +1,135 @@ +// Copyright (c) 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.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 { + /* + * 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; + + /** Creates an instance of EncodedTaskStep class. */ + public EncodedTaskStep() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EncodedTaskStep.class); +} 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..7bdf4c6a0eead --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncodedTaskStepUpdateParameters.java @@ -0,0 +1,126 @@ +// Copyright (c) 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.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 { + /* + * 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; + + /** Creates an instance of EncodedTaskStepUpdateParameters class. */ + public EncodedTaskStepUpdateParameters() { + } + + /** + * 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..56f77a86146bb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionProperty.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.fasterxml.jackson.annotation.JsonProperty; + +/** The EncryptionProperty model. */ +@Fluent +public final class EncryptionProperty { + /* + * 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; + + /** Creates an instance of EncryptionProperty class. */ + public EncryptionProperty() { + } + + /** + * 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..13fb9da538c81 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates whether or not the encryption is enabled for container registry. */ +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 a new instance of EncryptionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EncryptionStatus() { + } + + /** + * 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); + } + + /** + * Gets known EncryptionStatus values. + * + * @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..e3769b16f93b4 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The content of the event request message. */ +@Fluent +public final class EventContent { + /* + * 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; + + /** Creates an instance of EventContent class. */ + public EventContent() { + } + + /** + * 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..21e1e71cd6c16 --- /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.resourcemanager.containerregistry.generated.fluent.models.EventInner; +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 { + /* + * 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; + + /** Creates an instance of EventListResult class. */ + public EventListResult() { + } + + /** + * 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..6d8202d491a10 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventRequestMessage.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The event request message sent to the service URI. */ +@Fluent +public final class EventRequestMessage { + /* + * The content of the event request message. + */ + @JsonProperty(value = "content") + private EventContent content; + + /* + * The headers of the event request message. + */ + @JsonProperty(value = "headers") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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; + + /** Creates an instance of EventRequestMessage class. */ + public EventRequestMessage() { + } + + /** + * 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..4c6162990c110 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventResponseMessage.java @@ -0,0 +1,157 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The event response message received from the service URI. */ +@Fluent +public final class EventResponseMessage { + /* + * The content of the event response message. + */ + @JsonProperty(value = "content") + private String content; + + /* + * The headers of the event response message. + */ + @JsonProperty(value = "headers") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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; + + /** Creates an instance of EventResponseMessage class. */ + public EventResponseMessage() { + } + + /** + * 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..fb21407e5d053 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipeline.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.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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 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. The name is case insensitive. + * @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..8307296169907 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineListResult.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.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +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 { + /* + * 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; + + /** Creates an instance of ExportPipelineListResult class. */ + public ExportPipelineListResult() { + } + + /** + * 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..77de9622a0fdd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineTargetProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) 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.JsonProperty; + +/** The properties of the export pipeline target. */ +@Fluent +public final class ExportPipelineTargetProperties { + /* + * 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; + + /** Creates an instance of ExportPipelineTargetProperties class. */ + public ExportPipelineTargetProperties() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExportPipelineTargetProperties.class); +} 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..47aa038c9bbae --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelines.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.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 { + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..1886f80eb2c86 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The export policy for a container registry. */ +@Fluent +public final class ExportPolicy { + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private ExportPolicyStatus status; + + /** Creates an instance of ExportPolicy class. */ + public ExportPolicy() { + } + + /** + * 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..0459f1cf00e70 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicyStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The value that indicates whether the policy is enabled or not. */ +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 a new instance of ExportPolicyStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExportPolicyStatus() { + } + + /** + * 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); + } + + /** + * Gets known ExportPolicyStatus values. + * + * @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..6ff9d287ce985 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskRunRequest.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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 { + /* + * 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; + + /** Creates an instance of FileTaskRunRequest class. */ + public FileTaskRunRequest() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FileTaskRunRequest.class); +} 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..209f5384f3617 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskStep.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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 { + /* + * 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; + + /** Creates an instance of FileTaskStep class. */ + public FileTaskStep() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FileTaskStep.class); +} 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..3d24e7d0bcf45 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/FileTaskStepUpdateParameters.java @@ -0,0 +1,126 @@ +// Copyright (c) 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.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 { + /* + * 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; + + /** Creates an instance of FileTaskStepUpdateParameters class. */ + public FileTaskStepUpdateParameters() { + } + + /** + * 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..af5936d147201 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsParameters.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.models; + +import com.azure.core.annotation.Fluent; +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 { + /* + * 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; + + /** Creates an instance of GenerateCredentialsParameters class. */ + public GenerateCredentialsParameters() { + } + + /** + * 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..8a49c063922a8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IdentityProperties.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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed identity for the resource. */ +@Fluent +public final class IdentityProperties { + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + 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") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of IdentityProperties class. */ + public IdentityProperties() { + } + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * 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..b775b71905971 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for a registry image. */ +@Fluent +public final class ImageDescriptor { + /* + * The registry login server. + */ + @JsonProperty(value = "registry") + private String registry; + + /* + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /* + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /* + * The sha256-based digest of the image manifest. + */ + @JsonProperty(value = "digest") + private String digest; + + /** Creates an instance of ImageDescriptor class. */ + public ImageDescriptor() { + } + + /** + * 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..632a585c1cdb7 --- /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.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 { + /* + * 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; + + /** Creates an instance of ImageUpdateTrigger class. */ + public ImageUpdateTrigger() { + } + + /** + * 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..4ed54c2793f34 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportImageParameters.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.JsonProperty; +import java.util.List; + +/** The ImportImageParameters model. */ +@Fluent +public final class ImportImageParameters { + /* + * The source of the image. + */ + @JsonProperty(value = "source", required = true) + private ImportSource source; + + /* + * List of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag + * is also omitted). + */ + @JsonProperty(value = "targetTags") + private List targetTags; + + /* + * List of strings of repository names to do a manifest only copy. No tag will be created. + */ + @JsonProperty(value = "untaggedTargetRepositories") + private List untaggedTargetRepositories; + + /* + * When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the + * operation before any copying begins. + */ + @JsonProperty(value = "mode") + private ImportMode mode; + + /** Creates an instance of ImportImageParameters class. */ + public ImportImageParameters() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportImageParameters.class); +} 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..e44f2d201bb1f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportMode.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the + * operation before any copying begins. + */ +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 a new instance of ImportMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImportMode() { + } + + /** + * 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); + } + + /** + * Gets known ImportMode values. + * + * @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..d7b36896221c3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipeline.java @@ -0,0 +1,233 @@ +// Copyright (c) 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 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. The name is case insensitive. + * @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..49dbbff1a2d43 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineListResult.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.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +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 { + /* + * 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; + + /** Creates an instance of ImportPipelineListResult class. */ + public ImportPipelineListResult() { + } + + /** + * 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..70f25fa2888ad --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineSourceProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) 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.JsonProperty; + +/** The properties of the import pipeline source. */ +@Fluent +public final class ImportPipelineSourceProperties { + /* + * 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; + + /** Creates an instance of ImportPipelineSourceProperties class. */ + public ImportPipelineSourceProperties() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportPipelineSourceProperties.class); +} 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..ccd9c2821b015 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelines.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.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 { + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..df16a6c5de2c6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSource.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.JsonProperty; + +/** The ImportSource model. */ +@Fluent +public final class ImportSource { + /* + * The resource identifier of the source Azure Container Registry. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The address of the source registry (e.g. 'mcr.microsoft.com'). + */ + @JsonProperty(value = "registryUri") + private String registryUri; + + /* + * Credentials used when importing from a registry uri. + */ + @JsonProperty(value = "credentials") + private ImportSourceCredentials credentials; + + /* + * Repository name of the source image. + * Specify an image by repository ('hello-world'). This will use the 'latest' tag. + * Specify an image by tag ('hello-world:latest'). + * Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + */ + @JsonProperty(value = "sourceImage", required = true) + private String sourceImage; + + /** Creates an instance of ImportSource class. */ + public ImportSource() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportSource.class); +} 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..f03e372825f35 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSourceCredentials.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.JsonProperty; + +/** The ImportSourceCredentials model. */ +@Fluent +public final class ImportSourceCredentials { + /* + * The username to authenticate with the source registry. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The password used to authenticate with the source registry. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /** Creates an instance of ImportSourceCredentials class. */ + public ImportSourceCredentials() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportSourceCredentials.class); +} 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..b906221da134a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IpRule.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.JsonProperty; + +/** IP rule with specific IP or IP range in CIDR format. */ +@Fluent +public final class IpRule { + /* + * 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; + + /** Creates an instance of IpRule class. */ + public IpRule() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpRule.class); +} 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..8374f8a13d52e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/KeyVaultProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The KeyVaultProperties model. */ +@Fluent +public final class KeyVaultProperties { + /* + * Key vault uri to access the encryption key. + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /* + * The fully qualified key identifier that includes the version of the key that is actually used for encryption. + */ + @JsonProperty(value = "versionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String versionedKeyIdentifier; + + /* + * The client id of the identity which will be used to access key vault. + */ + @JsonProperty(value = "identity") + private String identity; + + /* + * 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; + + /** Creates an instance of KeyVaultProperties class. */ + public KeyVaultProperties() { + } + + /** + * 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..0487503c3445b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LogLevel.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The verbosity of logs persisted on the connected registry. */ +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 a new instance of LogLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogLevel() { + } + + /** + * 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); + } + + /** + * Gets known LogLevel values. + * + * @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..f5a4c596c483e --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The logging properties of the connected registry. */ +@Fluent +public final class LoggingProperties { + /* + * 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; + + /** Creates an instance of LoggingProperties class. */ + public LoggingProperties() { + } + + /** + * 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..79ac1d6262f51 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The login server properties of the connected registry. */ +@Immutable +public final class LoginServerProperties { + /* + * 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; + + /** Creates an instance of LoginServerProperties class. */ + public LoginServerProperties() { + } + + /** + * 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/MetadataSearch.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/MetadataSearch.java new file mode 100644 index 0000000000000..1c16d3e8db615 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/MetadataSearch.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Determines whether registry artifacts are indexed for metadata search. */ +public final class MetadataSearch extends ExpandableStringEnum { + /** Static value Enabled for MetadataSearch. */ + public static final MetadataSearch ENABLED = fromString("Enabled"); + + /** Static value Disabled for MetadataSearch. */ + public static final MetadataSearch DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of MetadataSearch value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MetadataSearch() { + } + + /** + * Creates or finds a MetadataSearch from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetadataSearch. + */ + @JsonCreator + public static MetadataSearch fromString(String name) { + return fromString(name, MetadataSearch.class); + } + + /** + * Gets known MetadataSearch values. + * + * @return known MetadataSearch values. + */ + public static Collection values() { + return values(MetadataSearch.class); + } +} 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..26b68eab01d7f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleBypassOptions.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Whether to allow trusted Azure services to access a network restricted registry. */ +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 a new instance of NetworkRuleBypassOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkRuleBypassOptions() { + } + + /** + * 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); + } + + /** + * Gets known NetworkRuleBypassOptions values. + * + * @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..6146be729308b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleSet.java @@ -0,0 +1,88 @@ +// Copyright (c) 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.JsonProperty; +import java.util.List; + +/** The network rule set for a container registry. */ +@Fluent +public final class NetworkRuleSet { + /* + * The default action of allow or deny when no other rules match. + */ + @JsonProperty(value = "defaultAction", required = true) + private DefaultAction defaultAction; + + /* + * The IP ACL rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** Creates an instance of NetworkRuleSet class. */ + public NetworkRuleSet() { + } + + /** + * 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 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 (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkRuleSet.class); +} 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..f2af136a4478b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OS.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The OS of agent machine. */ +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 a new instance of OS value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OS() { + } + + /** + * 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); + } + + /** + * Gets known OS values. + * + * @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..5579dbbf5f9e3 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The display information for a container registry operation. */ +@Fluent +public final class OperationDisplayDefinition { + /* + * The resource provider name: Microsoft.ContainerRegistry. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The operation that users can perform. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * The description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of OperationDisplayDefinition class. */ + public OperationDisplayDefinition() { + } + + /** + * 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..0a21abc717e11 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationListResult.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.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; +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 { + /* + * 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; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * 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..5b58cf43bbdfd --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of Azure Monitoring log. */ +@Fluent +public final class OperationLogSpecificationDefinition { + /* + * 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; + + /** Creates an instance of OperationLogSpecificationDefinition class. */ + public OperationLogSpecificationDefinition() { + } + + /** + * 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..6e1c4d6f76d90 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of Azure Monitoring metric. */ +@Fluent +public final class OperationMetricSpecificationDefinition { + /* + * Metric name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Metric display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Metric description. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Metric unit. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Metric aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Internal metric name. + */ + @JsonProperty(value = "internalMetricName") + private String internalMetricName; + + /** Creates an instance of OperationMetricSpecificationDefinition class. */ + public OperationMetricSpecificationDefinition() { + } + + /** + * 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..76f8aaf9b1ec7 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The definition of Azure Monitoring list. */ +@Fluent +public final class OperationServiceSpecificationDefinition { + /* + * 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; + + /** Creates an instance of OperationServiceSpecificationDefinition class. */ + public OperationServiceSpecificationDefinition() { + } + + /** + * 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..8f2a986fd1cd4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Operations.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.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 as paginated response with {@link + * PagedIterable}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + 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..930dca931c7cf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OverrideTaskStepProperties.java @@ -0,0 +1,192 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The OverrideTaskStepProperties model. */ +@Fluent +public final class OverrideTaskStepProperties { + /* + * The source context against which run has to be queued. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /* + * The file against which run has to be queued. + */ + @JsonProperty(value = "file") + private String file; + + /* + * Gets or sets the collection of override arguments to be used when + * executing a build step. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /* + * The name of the target build stage for the docker build. + */ + @JsonProperty(value = "target") + private String target; + + /* + * The collection of overridable values that can be passed when running a Task. + */ + @JsonProperty(value = "values") + private List values; + + /* + * Base64 encoded update trigger token that will be attached with the base image trigger webhook. + */ + @JsonProperty(value = "updateTriggerToken") + private String updateTriggerToken; + + /** Creates an instance of OverrideTaskStepProperties class. */ + public OverrideTaskStepProperties() { + } + + /** + * 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/PackageSourceType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PackageSourceType.java new file mode 100644 index 0000000000000..06274a51de121 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PackageSourceType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of package source for a archive. */ +public final class PackageSourceType extends ExpandableStringEnum { + /** Static value remote for PackageSourceType. */ + public static final PackageSourceType REMOTE = fromString("remote"); + + /** + * Creates a new instance of PackageSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PackageSourceType() { + } + + /** + * Creates or finds a PackageSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PackageSourceType. + */ + @JsonCreator + public static PackageSourceType fromString(String name) { + return fromString(name, PackageSourceType.class); + } + + /** + * Gets known PackageSourceType values. + * + * @return known PackageSourceType values. + */ + public static Collection values() { + return values(PackageSourceType.class); + } +} 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..55cadb04afb6e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ParentProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the connected registry parent. */ +@Fluent +public final class ParentProperties { + /* + * 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; + + /** Creates an instance of ParentProperties class. */ + public ParentProperties() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ParentProperties.class); +} 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..c5b845ad98026 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PasswordName.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The password name. */ +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) { + if (value == null) { + return null; + } + PasswordName[] items = PasswordName.values(); + for (PasswordName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..d295c51c21529 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineOptions.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.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 a new instance of PipelineOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PipelineOptions() { + } + + /** + * 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); + } + + /** + * Gets known PipelineOptions values. + * + * @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..56b7273af044b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRun.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.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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 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. The name is case insensitive. + * @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..8132ccce7b721 --- /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.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; +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 { + /* + * 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; + + /** Creates an instance of PipelineRunListResult class. */ + public PipelineRunListResult() { + } + + /** + * 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..e0c90325213b3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunRequest.java @@ -0,0 +1,168 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The request properties provided for a pipeline run. */ +@Fluent +public final class PipelineRunRequest { + /* + * 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; + + /** Creates an instance of PipelineRunRequest class. */ + public PipelineRunRequest() { + } + + /** + * 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..02b208b27f9d4 --- /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.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 { + /* + * 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; + + /** Creates an instance of PipelineRunResponse class. */ + public PipelineRunResponse() { + } + + /** + * 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..353a3cefc6ecb --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineRunSourceProperties model. */ +@Fluent +public final class PipelineRunSourceProperties { + /* + * The type of the source. + */ + @JsonProperty(value = "type") + private PipelineRunSourceType type; + + /* + * The name of the source. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of PipelineRunSourceProperties class. */ + public PipelineRunSourceProperties() { + } + + /** + * 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..e821bf6bbdfd4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the source. */ +public final class PipelineRunSourceType extends ExpandableStringEnum { + /** Static value AzureStorageBlob for PipelineRunSourceType. */ + public static final PipelineRunSourceType AZURE_STORAGE_BLOB = fromString("AzureStorageBlob"); + + /** + * Creates a new instance of PipelineRunSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PipelineRunSourceType() { + } + + /** + * 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); + } + + /** + * Gets known PipelineRunSourceType values. + * + * @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..c1522de31ae50 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineRunTargetProperties model. */ +@Fluent +public final class PipelineRunTargetProperties { + /* + * The type of the target. + */ + @JsonProperty(value = "type") + private PipelineRunTargetType type; + + /* + * The name of the target. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of PipelineRunTargetProperties class. */ + public PipelineRunTargetProperties() { + } + + /** + * 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..65488b1882d03 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the target. */ +public final class PipelineRunTargetType extends ExpandableStringEnum { + /** Static value AzureStorageBlob for PipelineRunTargetType. */ + public static final PipelineRunTargetType AZURE_STORAGE_BLOB = fromString("AzureStorageBlob"); + + /** + * Creates a new instance of PipelineRunTargetType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PipelineRunTargetType() { + } + + /** + * 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); + } + + /** + * Gets known PipelineRunTargetType values. + * + * @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..395b44aee0534 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRuns.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.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 { + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..9c73aeef3d77a --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The PipelineSourceTriggerDescriptor model. */ +@Fluent +public final class PipelineSourceTriggerDescriptor { + /* + * The timestamp when the source update happened. + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /** Creates an instance of PipelineSourceTriggerDescriptor class. */ + public PipelineSourceTriggerDescriptor() { + } + + /** + * 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..56da17ea14ed5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerProperties.java @@ -0,0 +1,59 @@ +// Copyright (c) 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.JsonProperty; + +/** The PipelineSourceTriggerProperties model. */ +@Fluent +public final class PipelineSourceTriggerProperties { + /* + * The current status of the source trigger. + */ + @JsonProperty(value = "status", required = true) + private TriggerStatus status; + + /** Creates an instance of PipelineSourceTriggerProperties class. */ + public PipelineSourceTriggerProperties() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PipelineSourceTriggerProperties.class); +} 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..f1256f9373797 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of source for the import pipeline. */ +public final class PipelineSourceType extends ExpandableStringEnum { + /** Static value AzureStorageBlobContainer for PipelineSourceType. */ + public static final PipelineSourceType AZURE_STORAGE_BLOB_CONTAINER = fromString("AzureStorageBlobContainer"); + + /** + * Creates a new instance of PipelineSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PipelineSourceType() { + } + + /** + * 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); + } + + /** + * Gets known PipelineSourceType values. + * + * @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..ec9dc5af7361a --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineTriggerDescriptor model. */ +@Fluent +public final class PipelineTriggerDescriptor { + /* + * The source trigger that caused the pipeline run. + */ + @JsonProperty(value = "sourceTrigger") + private PipelineSourceTriggerDescriptor sourceTrigger; + + /** Creates an instance of PipelineTriggerDescriptor class. */ + public PipelineTriggerDescriptor() { + } + + /** + * 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..623c5b23de6c9 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineTriggerProperties model. */ +@Fluent +public final class PipelineTriggerProperties { + /* + * The source trigger properties of the pipeline. + */ + @JsonProperty(value = "sourceTrigger") + private PipelineSourceTriggerProperties sourceTrigger; + + /** Creates an instance of PipelineTriggerProperties class. */ + public PipelineTriggerProperties() { + } + + /** + * 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..b352972f610a5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PlatformProperties.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.JsonProperty; + +/** The platform properties against which the run has to happen. */ +@Fluent +public final class PlatformProperties { + /* + * 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; + + /** Creates an instance of PlatformProperties class. */ + public PlatformProperties() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PlatformProperties.class); +} 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..4a14589d1a9e1 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties for updating the platform configuration. */ +@Fluent +public final class PlatformUpdateParameters { + /* + * 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; + + /** Creates an instance of PlatformUpdateParameters class. */ + public PlatformUpdateParameters() { + } + + /** + * 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..1ed3d2d3f5776 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Policies.java @@ -0,0 +1,201 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; + +/** The policies for a container registry. */ +@Fluent +public final class Policies { + /* + * The quarantine policy for a container registry. + */ + @JsonProperty(value = "quarantinePolicy") + private QuarantinePolicy quarantinePolicy; + + /* + * The content trust policy for a container registry. + */ + @JsonProperty(value = "trustPolicy") + private TrustPolicy trustPolicy; + + /* + * The retention policy for a container registry. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /* + * The export policy for a container registry. + */ + @JsonProperty(value = "exportPolicy") + private ExportPolicy exportPolicy; + + /* + * The policy for using ARM audience token for a container registry. + */ + @JsonProperty(value = "azureADAuthenticationAsArmPolicy") + private AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy; + + /* + * The soft delete policy for a container registry. + */ + @JsonProperty(value = "softDeletePolicy") + private SoftDeletePolicy softDeletePolicy; + + /** Creates an instance of Policies class. */ + public Policies() { + } + + /** + * 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; + } + + /** + * Get the azureADAuthenticationAsArmPolicy property: The policy for using ARM audience token for a container + * registry. + * + * @return the azureADAuthenticationAsArmPolicy value. + */ + public AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy() { + return this.azureADAuthenticationAsArmPolicy; + } + + /** + * Set the azureADAuthenticationAsArmPolicy property: The policy for using ARM audience token for a container + * registry. + * + * @param azureADAuthenticationAsArmPolicy the azureADAuthenticationAsArmPolicy value to set. + * @return the Policies object itself. + */ + public Policies withAzureADAuthenticationAsArmPolicy( + AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy) { + this.azureADAuthenticationAsArmPolicy = azureADAuthenticationAsArmPolicy; + return this; + } + + /** + * Get the softDeletePolicy property: The soft delete policy for a container registry. + * + * @return the softDeletePolicy value. + */ + public SoftDeletePolicy softDeletePolicy() { + return this.softDeletePolicy; + } + + /** + * Set the softDeletePolicy property: The soft delete policy for a container registry. + * + * @param softDeletePolicy the softDeletePolicy value to set. + * @return the Policies object itself. + */ + public Policies withSoftDeletePolicy(SoftDeletePolicy softDeletePolicy) { + this.softDeletePolicy = softDeletePolicy; + 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(); + } + if (azureADAuthenticationAsArmPolicy() != null) { + azureADAuthenticationAsArmPolicy().validate(); + } + if (softDeletePolicy() != null) { + softDeletePolicy().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..4ccfb56e82072 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PolicyStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The value that indicates whether the policy is enabled or not. */ +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 a new instance of PolicyStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PolicyStatus() { + } + + /** + * 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); + } + + /** + * Gets known PolicyStatus values. + * + * @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..0d13eb5f54545 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpoint.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.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Fluent +public final class PrivateEndpoint { + /* + * This is private endpoint resource created with Microsoft.Network resource provider. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + + /** + * 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..edccc0d01eb28 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,218 @@ +// Copyright (c) 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. The name is case insensitive. + * @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..5c19761d9e47f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnectionListResult.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.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +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 { + /* + * 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; + + /** Creates an instance of PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + + /** + * 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..cfc591eebdf78 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnections.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * 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 along with {@link + * Response}. + */ + 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 along with {@link + * Response}. + */ + 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..e5ac8028bc023 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResourceListResult.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.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +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 { + /* + * 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; + + /** Creates an instance of PrivateLinkResourceListResult class. */ + public PrivateLinkResourceListResult() { + } + + /** + * 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..4684e8f36cc4c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkServiceConnectionState.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.fasterxml.jackson.annotation.JsonProperty; + +/** The state of a private link service connection. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * 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; + + /** Creates an instance of PrivateLinkServiceConnectionState class. */ + public PrivateLinkServiceConnectionState() { + } + + /** + * 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..517026dcd853b --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The ProgressProperties model. */ +@Fluent +public final class ProgressProperties { + /* + * The percentage complete of the copy operation. + */ + @JsonProperty(value = "percentage") + private String percentage; + + /** Creates an instance of ProgressProperties class. */ + public ProgressProperties() { + } + + /** + * 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..064d81e26d3cf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProvisioningState.java @@ -0,0 +1,59 @@ +// Copyright (c) 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; + +/** The provisioning state of this agent pool. */ +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 a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * 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); + } + + /** + * Gets known ProvisioningState values. + * + * @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..519ee0aa2ec0e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PublicNetworkAccess.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Whether or not public network access is allowed for the container registry. */ +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 a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * 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); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @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..506bd317ab243 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The quarantine policy for a container registry. */ +@Fluent +public final class QuarantinePolicy { + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** Creates an instance of QuarantinePolicy class. */ + public QuarantinePolicy() { + } + + /** + * 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..8640bc4f9fa74 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegenerateCredentialParameters.java @@ -0,0 +1,59 @@ +// Copyright (c) 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.JsonProperty; + +/** The parameters used to regenerate the login credential. */ +@Fluent +public final class RegenerateCredentialParameters { + /* + * Specifies name of the password which should be regenerated -- password or password2. + */ + @JsonProperty(value = "name", required = true) + private PasswordName name; + + /** Creates an instance of RegenerateCredentialParameters class. */ + public RegenerateCredentialParameters() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegenerateCredentialParameters.class); +} 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..1bf492a20da55 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registries.java @@ -0,0 +1,434 @@ +// Copyright (c) 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. + * @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 along with {@link + * Response}. + */ + Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listPrivateLinkResources(String resourceGroupName, String registryName); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context); + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @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 private link resource by a specified group name for a container registry along with {@link Response}. + */ + Response getPrivateLinkResourceWithResponse( + String resourceGroupName, String registryName, String groupName, Context context); + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 private link resource by a specified group name for a container registry. + */ + PrivateLinkResource getPrivateLinkResource(String resourceGroupName, String registryName, String groupName); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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. + * @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 along with {@link Response}. + */ + Response getBuildSourceUploadUrlWithResponse( + String resourceGroupName, String registryName, 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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..43cfdc64ac9f2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registry.java @@ -0,0 +1,769 @@ +// Copyright (c) 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 metadataSearch property: Determines whether registry artifacts are indexed for metadata search. + * + * @return the metadataSearch value. + */ + MetadataSearch metadataSearch(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. The name is case insensitive. + * @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, + DefinitionStages.WithMetadataSearch { + /** + * 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); + } + + /** The stage of the Registry definition allowing to specify metadataSearch. */ + interface WithMetadataSearch { + /** + * Specifies the metadataSearch property: Determines whether registry artifacts are indexed for metadata + * search.. + * + * @param metadataSearch Determines whether registry artifacts are indexed for metadata search. + * @return the next definition stage. + */ + WithCreate withMetadataSearch(MetadataSearch metadataSearch); + } + } + + /** + * 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, + UpdateStages.WithMetadataSearch { + /** + * 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); + } + + /** The stage of the Registry update allowing to specify metadataSearch. */ + interface WithMetadataSearch { + /** + * Specifies the metadataSearch property: Determines whether registry artifacts are indexed for metadata + * search.. + * + * @param metadataSearch Determines whether registry artifacts are indexed for metadata search. + * @return the next definition stage. + */ + Update withMetadataSearch(MetadataSearch metadataSearch); + } + } + + /** + * 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. + * + * @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 along with {@link Response}. + */ + Response listCredentialsWithResponse(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(); + + /** + * 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 along with {@link Response}. + */ + Response regenerateCredentialWithResponse( + RegenerateCredentialParameters regenerateCredentialParameters, 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); + + /** + * 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. + * + * @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 along with {@link Response}. + */ + Response getBuildSourceUploadUrlWithResponse(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(); +} 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..816cc5077960e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListResult.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.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list container registries. */ +@Fluent +public final class RegistryListResult { + /* + * 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; + + /** Creates an instance of RegistryListResult class. */ + public RegistryListResult() { + } + + /** + * 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..e0897a7cdbbe4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameCheckRequest.java @@ -0,0 +1,87 @@ +// Copyright (c) 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.JsonProperty; + +/** A request to check whether a container registry name is available. */ +@Fluent +public final class RegistryNameCheckRequest { + /* + * The name of the container registry. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + */ + @JsonProperty(value = "type", required = true) + private String type = "Microsoft.ContainerRegistry/registries"; + + /** 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegistryNameCheckRequest.class); +} 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..e031b0fe86303 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The login password for the container registry. */ +@Fluent +public final class RegistryPassword { + /* + * The password name. + */ + @JsonProperty(value = "name") + private PasswordName name; + + /* + * The password value. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of RegistryPassword class. */ + public RegistryPassword() { + } + + /** + * 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..a671e3f6b03ee --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUpdateParameters.java @@ -0,0 +1,339 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.fluent.models.RegistryPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a container registry. */ +@Fluent +public final class RegistryUpdateParameters { + /* + * The identity of the container registry. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The tags for the container registry. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The SKU of the container registry. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * The properties that the container registry will be updated with. + */ + @JsonProperty(value = "properties") + private RegistryPropertiesUpdateParameters innerProperties; + + /** Creates an instance of RegistryUpdateParameters class. */ + public RegistryUpdateParameters() { + } + + /** + * 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 innerProperties property: The properties that the container registry will be updated with. + * + * @return the innerProperties value. + */ + private RegistryPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value. + */ + public Boolean adminUserEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withAdminUserEnabled(adminUserEnabled); + return this; + } + + /** + * Get the networkRuleSet property: The network rule set for a container registry. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withNetworkRuleSet(networkRuleSet); + return this; + } + + /** + * Get the policies property: The policies for a container registry. + * + * @return the policies value. + */ + public Policies policies() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withPolicies(policies); + return this; + } + + /** + * Get the encryption property: The encryption settings of container registry. + * + * @return the encryption value. + */ + public EncryptionProperty encryption() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withEncryption(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withDataEndpointEnabled(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withPublicNetworkAccess(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withNetworkRuleBypassOptions(networkRuleBypassOptions); + return this; + } + + /** + * Get the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @return the anonymousPullEnabled value. + */ + public Boolean anonymousPullEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withAnonymousPullEnabled(anonymousPullEnabled); + return this; + } + + /** + * Get the metadataSearch property: Determines whether registry artifacts are indexed for metadata search. + * + * @return the metadataSearch value. + */ + public MetadataSearch metadataSearch() { + return this.innerProperties() == null ? null : this.innerProperties().metadataSearch(); + } + + /** + * Set the metadataSearch property: Determines whether registry artifacts are indexed for metadata search. + * + * @param metadataSearch the metadataSearch value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withMetadataSearch(MetadataSearch metadataSearch) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withMetadataSearch(metadataSearch); + 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 (innerProperties() != null) { + innerProperties().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..0aa8eb3d075be --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The quota usage for a container registry. */ +@Fluent +public final class RegistryUsage { + /* + * The name of the usage. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The limit of the usage. + */ + @JsonProperty(value = "limit") + private Long limit; + + /* + * The current value of the usage. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /* + * The unit of measurement. + */ + @JsonProperty(value = "unit") + private RegistryUsageUnit unit; + + /** Creates an instance of RegistryUsage class. */ + public RegistryUsage() { + } + + /** + * 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..e48c90c25a1c3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageUnit.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The unit of measurement. */ +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 a new instance of RegistryUsageUnit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RegistryUsageUnit() { + } + + /** + * 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); + } + + /** + * Gets known RegistryUsageUnit values. + * + * @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..035e84041ac7e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replication.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.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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. The name is case insensitive. + * @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..e05dd7dda2b37 --- /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.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +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 { + /* + * 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; + + /** Creates an instance of ReplicationListResult class. */ + public ReplicationListResult() { + } + + /** + * 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..5d4604c63bf62 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationUpdateParameters.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.resourcemanager.containerregistry.generated.fluent.models.ReplicationUpdateParametersProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a replication. */ +@Fluent +public final class ReplicationUpdateParameters { + /* + * The tags for the replication. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The parameters for updating a replication's properties + */ + @JsonProperty(value = "properties") + private ReplicationUpdateParametersProperties innerProperties; + + /** Creates an instance of ReplicationUpdateParameters class. */ + public ReplicationUpdateParameters() { + } + + /** + * 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 innerProperties property: The parameters for updating a replication's properties. + * + * @return the innerProperties value. + */ + private ReplicationUpdateParametersProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ReplicationUpdateParametersProperties(); + } + this.innerProperties().withRegionEndpointEnabled(regionEndpointEnabled); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..bd7d7b40c64e0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replications.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.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 { + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..7293d12b75627 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Request.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The request that generated the event. */ +@Fluent +public final class Request { + /* + * The ID of the request that initiated the event. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr + * from the standard http request. + */ + @JsonProperty(value = "addr") + private String addr; + + /* + * The externally accessible hostname of the registry instance, as specified by the http host header on incoming + * requests. + */ + @JsonProperty(value = "host") + private String host; + + /* + * The request method that generated the event. + */ + @JsonProperty(value = "method") + private String method; + + /* + * The user agent header of the request. + */ + @JsonProperty(value = "useragent") + private String useragent; + + /** Creates an instance of Request class. */ + public Request() { + } + + /** + * 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..27b04a0fe0d8c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ResourceIdentityType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The identity type. */ +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) { + if (value == null) { + return null; + } + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..ab09f28c9433b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RetentionPolicy.java @@ -0,0 +1,92 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The retention policy for a container registry. */ +@Fluent +public final class RetentionPolicy { + /* + * The number of days to retain an untagged manifest after which it gets purged. + */ + @JsonProperty(value = "days") + private Integer days; + + /* + * The timestamp when the policy was last updated. + */ + @JsonProperty(value = "lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTime; + + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** Creates an instance of RetentionPolicy class. */ + public RetentionPolicy() { + } + + /** + * 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..3ced4e0de6058 --- /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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 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..c0a26ff52fb32 --- /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.resourcemanager.containerregistry.generated.fluent.models.RunInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of runs. */ +@Fluent +public final class RunListResult { + /* + * 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; + + /** Creates an instance of RunListResult class. */ + public RunListResult() { + } + + /** + * 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..51e087bc01fbf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunRequest.java @@ -0,0 +1,119 @@ +// Copyright (c) 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.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 { + /* + * 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; + + /** Creates an instance of RunRequest class. */ + public RunRequest() { + } + + /** + * 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..e09a129cd2597 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunStatus.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current status of the run. */ +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 a new instance of RunStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RunStatus() { + } + + /** + * 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); + } + + /** + * Gets known RunStatus values. + * + * @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..89b1ce0fc4c33 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RunType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of run. */ +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 a new instance of RunType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RunType() { + } + + /** + * 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); + } + + /** + * Gets known RunType values. + * + * @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..278afe281b2b1 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The set of run properties that can be updated. */ +@Fluent +public final class RunUpdateParameters { + /* + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** Creates an instance of RunUpdateParameters class. */ + public RunUpdateParameters() { + } + + /** + * 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..5ddc3c8ee94c7 --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String runId, 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); + + /** + * 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. + * @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 along with {@link Response}. + */ + Response getLogSasUrlWithResponse( + String resourceGroupName, String registryName, String runId, 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); + + /** + * 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..1f05a81f19aa7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMap.java @@ -0,0 +1,228 @@ +// Copyright (c) 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. The name is case insensitive. + * @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..e23147155a09f --- /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.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +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 { + /* + * 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; + + /** Creates an instance of ScopeMapListResult class. */ + public ScopeMapListResult() { + } + + /** + * 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..ef67f7bd470ba --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapUpdateParameters.java @@ -0,0 +1,92 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.fluent.models.ScopeMapPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties for updating the scope map. */ +@Fluent +public final class ScopeMapUpdateParameters { + /* + * The update parameters for scope map properties. + */ + @JsonProperty(value = "properties") + private ScopeMapPropertiesUpdateParameters innerProperties; + + /** Creates an instance of ScopeMapUpdateParameters class. */ + public ScopeMapUpdateParameters() { + } + + /** + * Get the innerProperties property: The update parameters for scope map properties. + * + * @return the innerProperties value. + */ + private ScopeMapPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the description property: The user friendly description of the scope map. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeMapPropertiesUpdateParameters(); + } + this.innerProperties().withDescription(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeMapPropertiesUpdateParameters(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..a0dd4ee5bad9c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMaps.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.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 { + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..4c3a0cd90907f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SecretObject.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a secret object value. */ +@Fluent +public final class SecretObject { + /* + * The value of the secret. The format of this value will be determined + * based on the type of the secret object. If the type is Opaque, the value will be + * used as is without any modification. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The type of the secret object which determines how the value of the secret object has to be + * interpreted. + */ + @JsonProperty(value = "type") + private SecretObjectType type; + + /** Creates an instance of SecretObject class. */ + public SecretObject() { + } + + /** + * 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..dc0d2ebd27175 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SecretObjectType.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the secret object which determines how the value of the secret object has to be interpreted. */ +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 a new instance of SecretObjectType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecretObjectType() { + } + + /** + * 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); + } + + /** + * Gets known SecretObjectType values. + * + * @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..959886becdab7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SetValue.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.JsonProperty; + +/** The properties of a overridable value that can be passed to a task template. */ +@Fluent +public final class SetValue { + /* + * The name of the overridable value. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The overridable value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /* + * Flag to indicate whether the value represents a secret or not. + */ + @JsonProperty(value = "isSecret") + private Boolean isSecret; + + /** Creates an instance of SetValue class. */ + public SetValue() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SetValue.class); +} 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..841650c817099 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Sku.java @@ -0,0 +1,72 @@ +// Copyright (c) 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.JsonProperty; + +/** The SKU of a container registry. */ +@Fluent +public final class Sku { + /* + * 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; + + /** Creates an instance of Sku class. */ + public Sku() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); +} 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..b3a294363e78f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuName.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The SKU name of the container registry. Required for registry creation. */ +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 a new instance of SkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuName() { + } + + /** + * 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); + } + + /** + * Gets known SkuName values. + * + * @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..61f912b78f08a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuTier.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The SKU tier based on the SKU name. */ +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 a new instance of SkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuTier() { + } + + /** + * 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); + } + + /** + * Gets known SkuTier values. + * + * @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/SoftDeletePolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SoftDeletePolicy.java new file mode 100644 index 0000000000000..9459ec48d0b46 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SoftDeletePolicy.java @@ -0,0 +1,92 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The soft delete policy for a container registry. */ +@Fluent +public final class SoftDeletePolicy { + /* + * The number of days after which a soft-deleted item is permanently deleted. + */ + @JsonProperty(value = "retentionDays") + private Integer retentionDays; + + /* + * 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; + + /** Creates an instance of SoftDeletePolicy class. */ + public SoftDeletePolicy() { + } + + /** + * Get the retentionDays property: The number of days after which a soft-deleted item is permanently deleted. + * + * @return the retentionDays value. + */ + public Integer retentionDays() { + return this.retentionDays; + } + + /** + * Set the retentionDays property: The number of days after which a soft-deleted item is permanently deleted. + * + * @param retentionDays the retentionDays value to set. + * @return the SoftDeletePolicy object itself. + */ + public SoftDeletePolicy withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + 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 SoftDeletePolicy object itself. + */ + public SoftDeletePolicy 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/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..5a1da2f7e2a25 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Source.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.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 { + /* + * 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; + + /** Creates an instance of Source class. */ + public Source() { + } + + /** + * 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..fae1c326feed6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceControlType.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of source control service. */ +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 a new instance of SourceControlType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceControlType() { + } + + /** + * 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); + } + + /** + * Gets known SourceControlType values. + * + * @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..857fd21574446 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceProperties.java @@ -0,0 +1,148 @@ +// Copyright (c) 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.JsonProperty; + +/** The properties of the source code repository. */ +@Fluent +public final class SourceProperties { + /* + * 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; + + /** Creates an instance of SourceProperties class. */ + public SourceProperties() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SourceProperties.class); +} 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..b48c64c882c8e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceRegistryCredentials.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the credential parameters for accessing the source registry. */ +@Fluent +public final class SourceRegistryCredentials { + /* + * The authentication mode which determines the source registry login scope. The credentials for the source + * registry + * will be generated using the given scope. These credentials will be used to login to + * the source registry during the run. + */ + @JsonProperty(value = "loginMode") + private SourceRegistryLoginMode loginMode; + + /** Creates an instance of SourceRegistryCredentials class. */ + public SourceRegistryCredentials() { + } + + /** + * 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..cd7544b2df0ae --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceRegistryLoginMode.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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. + */ +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 a new instance of SourceRegistryLoginMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceRegistryLoginMode() { + } + + /** + * 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); + } + + /** + * Gets known SourceRegistryLoginMode values. + * + * @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..2f0eec6709050 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTrigger.java @@ -0,0 +1,150 @@ +// Copyright (c) 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.JsonProperty; +import java.util.List; + +/** The properties of a source based trigger. */ +@Fluent +public final class SourceTrigger { + /* + * The properties that describes the source(code) for the task. + */ + @JsonProperty(value = "sourceRepository", required = true) + private SourceProperties sourceRepository; + + /* + * The source event corresponding to the trigger. + */ + @JsonProperty(value = "sourceTriggerEvents", required = true) + private List sourceTriggerEvents; + + /* + * The current status of trigger. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /* + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** Creates an instance of SourceTrigger class. */ + public SourceTrigger() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SourceTrigger.class); +} 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..e43f039b3e833 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The source trigger that caused a run. */ +@Fluent +public final class SourceTriggerDescriptor { + /* + * The unique ID of the trigger. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The event type of the trigger. + */ + @JsonProperty(value = "eventType") + private String eventType; + + /* + * The unique ID that identifies a commit. + */ + @JsonProperty(value = "commitId") + private String commitId; + + /* + * The unique ID that identifies pull request. + */ + @JsonProperty(value = "pullRequestId") + private String pullRequestId; + + /* + * The repository URL. + */ + @JsonProperty(value = "repositoryUrl") + private String repositoryUrl; + + /* + * The branch name in the repository. + */ + @JsonProperty(value = "branchName") + private String branchName; + + /* + * The source control provider type. + */ + @JsonProperty(value = "providerType") + private String providerType; + + /** Creates an instance of SourceTriggerDescriptor class. */ + public SourceTriggerDescriptor() { + } + + /** + * 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..0e6bf8e3e6428 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerEvent.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.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 a new instance of SourceTriggerEvent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceTriggerEvent() { + } + + /** + * 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); + } + + /** + * Gets known SourceTriggerEvent values. + * + * @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..df3c81f8100fd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceTriggerUpdateParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties for updating a source based trigger. */ +@Fluent +public final class SourceTriggerUpdateParameters { + /* + * The properties that describes the source(code) for the task. + */ + @JsonProperty(value = "sourceRepository") + private SourceUpdateParameters sourceRepository; + + /* + * The source event corresponding to the trigger. + */ + @JsonProperty(value = "sourceTriggerEvents") + private List sourceTriggerEvents; + + /* + * The current status of trigger. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /* + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** Creates an instance of SourceTriggerUpdateParameters class. */ + public SourceTriggerUpdateParameters() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SourceTriggerUpdateParameters.class); +} 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..2fd28cdd5a57e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SourceUpdateParameters.java @@ -0,0 +1,135 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties for updating the source code repository. */ +@Fluent +public final class SourceUpdateParameters { + /* + * 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; + + /** Creates an instance of SourceUpdateParameters class. */ + public SourceUpdateParameters() { + } + + /** + * 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..5eeed9c19a523 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Status.java @@ -0,0 +1,70 @@ +// Copyright (c) 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.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 { + /* + * 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; + + /** Creates an instance of Status class. */ + public Status() { + } + + /** + * 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..0caaa553beba4 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The status detail properties of the connected registry. */ +@Immutable +public final class StatusDetailProperties { + /* + * 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; + + /** Creates an instance of StatusDetailProperties class. */ + public StatusDetailProperties() { + } + + /** + * 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..69d9601c2edcc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StepType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the step. */ +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 a new instance of StepType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StepType() { + } + + /** + * 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); + } + + /** + * Gets known StepType values. + * + * @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..af8c0535eb0ef --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncProperties.java @@ -0,0 +1,184 @@ +// Copyright (c) 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.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** The sync properties of the connected registry with its parent. */ +@Fluent +public final class SyncProperties { + /* + * 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; + + /** Creates an instance of SyncProperties class. */ + public SyncProperties() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SyncProperties.class); +} 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..acf079f0a0fd3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncUpdateProperties.java @@ -0,0 +1,111 @@ +// Copyright (c) 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.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 { + /* + * 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; + + /** Creates an instance of SyncUpdateProperties class. */ + public SyncUpdateProperties() { + } + + /** + * 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..0daa7e009b6cb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Target.java @@ -0,0 +1,258 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; + +/** The target of the event. */ +@Fluent +public final class Target { + /* + * The MIME type of the referenced object. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /* + * The number of bytes of the content. Same as Length field. + */ + @JsonProperty(value = "size") + private Long size; + + /* + * The digest of the content, as defined by the Registry V2 HTTP API Specification. + */ + @JsonProperty(value = "digest") + private String digest; + + /* + * The number of bytes of the content. Same as Size field. + */ + @JsonProperty(value = "length") + private Long length; + + /* + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /* + * The direct URL to the content. + */ + @JsonProperty(value = "url") + private String url; + + /* + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /* + * The name of the artifact. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The version of the artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** Creates an instance of Target class. */ + public Target() { + } + + /** + * 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..5102b2ecfd69b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Task.java @@ -0,0 +1,593 @@ +// Copyright (c) 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. + * + * @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 along with {@link Response}. + */ + Response getDetailsWithResponse(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(); +} 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..374f41dce355c --- /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.resourcemanager.containerregistry.generated.fluent.models.TaskInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The collection of tasks. */ +@Fluent +public final class TaskListResult { + /* + * 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; + + /** Creates an instance of TaskListResult class. */ + public TaskListResult() { + } + + /** + * 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..cf118461ef5fc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRun.java @@ -0,0 +1,330 @@ +// Copyright (c) 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. + * + * @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 along with {@link Response}. + */ + Response getDetailsWithResponse(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(); +} 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..8f037a590ba15 --- /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.resourcemanager.containerregistry.generated.fluent.models.TaskRunInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The collection of task runs. */ +@Fluent +public final class TaskRunListResult { + /* + * 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; + + /** Creates an instance of TaskRunListResult class. */ + public TaskRunListResult() { + } + + /** + * 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/TaskRunProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunProperties.java new file mode 100644 index 0000000000000..3af690cd2f4c0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunProperties.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.resourcemanager.containerregistry.generated.fluent.models.TaskRunPropertiesInner; + +/** An immutable client-side representation of TaskRunProperties. */ +public interface TaskRunProperties { + /** + * 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 inner com.azure.resourcemanager.containerregistry.generated.fluent.models.TaskRunPropertiesInner object. + * + * @return the inner object. + */ + TaskRunPropertiesInner innerModel(); +} 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..372f731acd715 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunRequest.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.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 { + /* + * 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; + + /** Creates an instance of TaskRunRequest class. */ + public TaskRunRequest() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TaskRunRequest.class); +} 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..e0807e7fd0a59 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskRunUpdateParameters.java @@ -0,0 +1,175 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.fluent.models.TaskRunPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a task run. */ +@Fluent +public final class TaskRunUpdateParameters { + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The properties for updating a task run. + */ + @JsonProperty(value = "properties") + private TaskRunPropertiesUpdateParameters innerProperties; + + /* + * The location of the resource + */ + @JsonProperty(value = "location") + private String location; + + /* + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of TaskRunUpdateParameters class. */ + public TaskRunUpdateParameters() { + } + + /** + * 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 innerProperties property: The properties for updating a task run. + * + * @return the innerProperties value. + */ + private TaskRunPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskRunPropertiesUpdateParameters(); + } + this.innerProperties().withRunRequest(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskRunPropertiesUpdateParameters(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().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..8d0ff9500553f --- /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. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String taskRunName, 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 com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + * @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 along with {@link Response}. + */ + Response getDetailsWithResponse( + 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..ddbf31f83a184 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current status of task. */ +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 a new instance of TaskStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TaskStatus() { + } + + /** + * 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); + } + + /** + * Gets known TaskStatus values. + * + * @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..ab1717e6127f6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStepProperties.java @@ -0,0 +1,111 @@ +// Copyright (c) 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.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 { + /* + * 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; + + /** Creates an instance of TaskStepProperties class. */ + public TaskStepProperties() { + } + + /** + * 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..1b535a03e8e32 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskStepUpdateParameters.java @@ -0,0 +1,92 @@ +// Copyright (c) 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.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 { + /* + * 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; + + /** Creates an instance of TaskStepUpdateParameters class. */ + public TaskStepUpdateParameters() { + } + + /** + * 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..391e8684ce8a7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TaskUpdateParameters.java @@ -0,0 +1,312 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.fluent.models.TaskPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a task. */ +@Fluent +public final class TaskUpdateParameters { + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The properties for updating a task. + */ + @JsonProperty(value = "properties") + private TaskPropertiesUpdateParameters innerProperties; + + /* + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of TaskUpdateParameters class. */ + public TaskUpdateParameters() { + } + + /** + * 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 innerProperties property: The properties for updating a task. + * + * @return the innerProperties value. + */ + private TaskPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskPropertiesUpdateParameters(); + } + this.innerProperties().withStatus(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskPropertiesUpdateParameters(); + } + this.innerProperties().withPlatform(platform); + return this; + } + + /** + * Get the agentConfiguration property: The machine configuration of the run agent. + * + * @return the agentConfiguration value. + */ + public AgentProperties agentConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskPropertiesUpdateParameters(); + } + this.innerProperties().withAgentConfiguration(agentConfiguration); + return this; + } + + /** + * Get the agentPoolName property: The dedicated agent pool for the task. + * + * @return the agentPoolName value. + */ + public String agentPoolName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskPropertiesUpdateParameters(); + } + this.innerProperties().withAgentPoolName(agentPoolName); + return this; + } + + /** + * Get the timeout property: Run timeout in seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskPropertiesUpdateParameters(); + } + this.innerProperties().withTimeout(timeout); + return this; + } + + /** + * Get the step property: The properties for updating a task step. + * + * @return the step value. + */ + public TaskStepUpdateParameters step() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskPropertiesUpdateParameters(); + } + this.innerProperties().withStep(step); + return this; + } + + /** + * Get the trigger property: The properties for updating trigger properties. + * + * @return the trigger value. + */ + public TriggerUpdateParameters trigger() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskPropertiesUpdateParameters(); + } + this.innerProperties().withTrigger(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskPropertiesUpdateParameters(); + } + this.innerProperties().withCredentials(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TaskPropertiesUpdateParameters(); + } + this.innerProperties().withLogTemplate(logTemplate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().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..015450939a427 --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String taskName, 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); + + /** + * 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. + * @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 along with {@link Response}. + */ + Response getDetailsWithResponse( + 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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..e09742809f594 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTrigger.java @@ -0,0 +1,115 @@ +// Copyright (c) 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.JsonProperty; + +/** The properties of a timer trigger. */ +@Fluent +public final class TimerTrigger { + /* + * 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; + + /** Creates an instance of TimerTrigger class. */ + public TimerTrigger() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TimerTrigger.class); +} 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..62d6fca94cda9 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The TimerTriggerDescriptor model. */ +@Fluent +public final class TimerTriggerDescriptor { + /* + * The timer trigger name that caused the run. + */ + @JsonProperty(value = "timerTriggerName") + private String timerTriggerName; + + /* + * The occurrence that triggered the run. + */ + @JsonProperty(value = "scheduleOccurrence") + private String scheduleOccurrence; + + /** Creates an instance of TimerTriggerDescriptor class. */ + public TimerTriggerDescriptor() { + } + + /** + * 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..283d258ca3f76 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TimerTriggerUpdateParameters.java @@ -0,0 +1,111 @@ +// Copyright (c) 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.JsonProperty; + +/** The properties for updating a timer trigger. */ +@Fluent +public final class TimerTriggerUpdateParameters { + /* + * 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; + + /** Creates an instance of TimerTriggerUpdateParameters class. */ + public TimerTriggerUpdateParameters() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TimerTriggerUpdateParameters.class); +} 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..6e377f50b0a13 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The TLS certificate properties of the connected registry login server. */ +@Immutable +public final class TlsCertificateProperties { + /* + * 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; + + /** Creates an instance of TlsCertificateProperties class. */ + public TlsCertificateProperties() { + } + + /** + * 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..d1c0eb44b4cda --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The TLS properties of the connected registry login server. */ +@Immutable +public final class TlsProperties { + /* + * 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; + + /** Creates an instance of TlsProperties class. */ + public TlsProperties() { + } + + /** + * 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..db4dff05491e0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates whether HTTPS is enabled for the login server. */ +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 a new instance of TlsStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TlsStatus() { + } + + /** + * 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); + } + + /** + * Gets known TlsStatus values. + * + * @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..9bd9849d59da6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Token.java @@ -0,0 +1,247 @@ +// Copyright (c) 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. The name is case insensitive. + * @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..f307c8ec10f0c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificate.java @@ -0,0 +1,131 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The properties of a certificate used for authenticating a token. */ +@Fluent +public final class TokenCertificate { + /* + * 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; + + /** Creates an instance of TokenCertificate class. */ + public TokenCertificate() { + } + + /** + * 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..e2505227bd99a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificateName.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.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 a new instance of TokenCertificateName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TokenCertificateName() { + } + + /** + * 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); + } + + /** + * Gets known TokenCertificateName values. + * + * @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..8d51a69d19619 --- /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.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 { + /* + * The certificates property. + */ + @JsonProperty(value = "certificates") + private List certificates; + + /* + * The passwords property. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** Creates an instance of TokenCredentialsProperties class. */ + public TokenCredentialsProperties() { + } + + /** + * 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..2f494e710755e --- /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.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +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 { + /* + * 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; + + /** Creates an instance of TokenListResult class. */ + public TokenListResult() { + } + + /** + * 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..6590b87d001b1 --- /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.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 { + /* + * 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; + + /** Creates an instance of TokenPassword class. */ + public TokenPassword() { + } + + /** + * 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..67ab06e51ad45 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPasswordName.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The password name "password1" or "password2". */ +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 a new instance of TokenPasswordName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TokenPasswordName() { + } + + /** + * 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); + } + + /** + * Gets known TokenPasswordName values. + * + * @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..7a4dcdcf03d3b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The status of the token example enabled or disabled. */ +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 a new instance of TokenStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TokenStatus() { + } + + /** + * 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); + } + + /** + * Gets known TokenStatus values. + * + * @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..eab2f73778a17 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenType.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of Auth token. */ +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 a new instance of TokenType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TokenType() { + } + + /** + * 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); + } + + /** + * Gets known TokenType values. + * + * @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..7f7d8962e0c8f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenUpdateParameters.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.resourcemanager.containerregistry.generated.fluent.models.TokenUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating a token. */ +@Fluent +public final class TokenUpdateParameters { + /* + * The properties of the token update parameters. + */ + @JsonProperty(value = "properties") + private TokenUpdateProperties innerProperties; + + /** Creates an instance of TokenUpdateParameters class. */ + public TokenUpdateParameters() { + } + + /** + * Get the innerProperties property: The properties of the token update parameters. + * + * @return the innerProperties value. + */ + private TokenUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenUpdateProperties(); + } + this.innerProperties().withScopeMapId(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenUpdateProperties(); + } + this.innerProperties().withStatus(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenUpdateProperties(); + } + this.innerProperties().withCredentials(credentials); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..16f25e55bb074 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tokens.java @@ -0,0 +1,143 @@ +// Copyright (c) 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 { + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..2ce33f495fe24 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a trigger. */ +@Fluent +public final class TriggerProperties { + /* + * The collection of timer triggers. + */ + @JsonProperty(value = "timerTriggers") + private List timerTriggers; + + /* + * The collection of triggers based on source code repository. + */ + @JsonProperty(value = "sourceTriggers") + private List sourceTriggers; + + /* + * The trigger based on base image dependencies. + */ + @JsonProperty(value = "baseImageTrigger") + private BaseImageTrigger baseImageTrigger; + + /** Creates an instance of TriggerProperties class. */ + public TriggerProperties() { + } + + /** + * 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..ece022ff06d65 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current status of trigger. */ +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 a new instance of TriggerStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TriggerStatus() { + } + + /** + * 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); + } + + /** + * Gets known TriggerStatus values. + * + * @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..f2db1d6d2503b --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties for updating triggers. */ +@Fluent +public final class TriggerUpdateParameters { + /* + * The collection of timer triggers. + */ + @JsonProperty(value = "timerTriggers") + private List timerTriggers; + + /* + * The collection of triggers based on source code repository. + */ + @JsonProperty(value = "sourceTriggers") + private List sourceTriggers; + + /* + * The trigger based on base image dependencies. + */ + @JsonProperty(value = "baseImageTrigger") + private BaseImageTriggerUpdateParameters baseImageTrigger; + + /** Creates an instance of TriggerUpdateParameters class. */ + public TriggerUpdateParameters() { + } + + /** + * 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..ebe759501f66e --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The content trust policy for a container registry. */ +@Fluent +public final class TrustPolicy { + /* + * 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; + + /** Creates an instance of TrustPolicy class. */ + public TrustPolicy() { + } + + /** + * 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..94700fb460217 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicyType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of trust policy. */ +public final class TrustPolicyType extends ExpandableStringEnum { + /** Static value Notary for TrustPolicyType. */ + public static final TrustPolicyType NOTARY = fromString("Notary"); + + /** + * Creates a new instance of TrustPolicyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TrustPolicyType() { + } + + /** + * 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); + } + + /** + * Gets known TrustPolicyType values. + * + * @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..046a527f490dc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UpdateTriggerPayloadType.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of Payload body for Base image update triggers. */ +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 a new instance of UpdateTriggerPayloadType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpdateTriggerPayloadType() { + } + + /** + * 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); + } + + /** + * Gets known UpdateTriggerPayloadType values. + * + * @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..39ea8a65bd335 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UserIdentityProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** The UserIdentityProperties model. */ +@Immutable +public final class UserIdentityProperties { + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** Creates an instance of UserIdentityProperties class. */ + public UserIdentityProperties() { + } + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * 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..036b0b855121f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Variant.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Variant of the CPU. */ +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 a new instance of Variant value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Variant() { + } + + /** + * 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); + } + + /** + * Gets known Variant values. + * + * @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/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..9d1d7c820359e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhook.java @@ -0,0 +1,439 @@ +// Copyright (c) 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. The name is case insensitive. + * @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. + * + * @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 along with {@link Response}. + */ + Response pingWithResponse(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(); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listEvents(Context context); + + /** + * 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 along with {@link Response}. + */ + Response getCallbackConfigWithResponse(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(); +} 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..a256a2a357887 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookAction.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.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 a new instance of WebhookAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebhookAction() { + } + + /** + * 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); + } + + /** + * Gets known WebhookAction values. + * + * @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..a5cdb3ccea624 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookCreateParameters.java @@ -0,0 +1,227 @@ +// Copyright (c) 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.WebhookPropertiesCreateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters for creating a webhook. */ +@Fluent +public final class WebhookCreateParameters { + /* + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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 properties that the webhook will be created with. + */ + @JsonProperty(value = "properties") + private WebhookPropertiesCreateParameters innerProperties; + + /** Creates an instance of WebhookCreateParameters class. */ + public WebhookCreateParameters() { + } + + /** + * 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 innerProperties property: The properties that the webhook will be created with. + * + * @return the innerProperties value. + */ + private WebhookPropertiesCreateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + public String serviceUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesCreateParameters(); + } + this.innerProperties().withServiceUri(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesCreateParameters(); + } + this.innerProperties().withCustomHeaders(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesCreateParameters(); + } + this.innerProperties().withStatus(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesCreateParameters(); + } + this.innerProperties().withScope(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesCreateParameters(); + } + this.innerProperties().withActions(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")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebhookCreateParameters.class); +} 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..b4a8ca8b4b6d7 --- /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.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +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 { + /* + * 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; + + /** Creates an instance of WebhookListResult class. */ + public WebhookListResult() { + } + + /** + * 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..82443a32a1079 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The status of the webhook at the time the operation was called. */ +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 a new instance of WebhookStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebhookStatus() { + } + + /** + * 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); + } + + /** + * Gets known WebhookStatus values. + * + * @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..8c7a8d7e43783 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookUpdateParameters.java @@ -0,0 +1,192 @@ +// Copyright (c) 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.resourcemanager.containerregistry.generated.fluent.models.WebhookPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters for updating a webhook. */ +@Fluent +public final class WebhookUpdateParameters { + /* + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The properties that the webhook will be updated with. + */ + @JsonProperty(value = "properties") + private WebhookPropertiesUpdateParameters innerProperties; + + /** Creates an instance of WebhookUpdateParameters class. */ + public WebhookUpdateParameters() { + } + + /** + * 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 innerProperties property: The properties that the webhook will be updated with. + * + * @return the innerProperties value. + */ + private WebhookPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + public String serviceUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesUpdateParameters(); + } + this.innerProperties().withServiceUri(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesUpdateParameters(); + } + this.innerProperties().withCustomHeaders(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesUpdateParameters(); + } + this.innerProperties().withStatus(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesUpdateParameters(); + } + this.innerProperties().withScope(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesUpdateParameters(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..b166e3e794547 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhooks.java @@ -0,0 +1,227 @@ +// Copyright (c) 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 { + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listEvents(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. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getCallbackConfigWithResponse( + 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. The name is case insensitive. + * @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 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..7d7a715ff629f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ZoneRedundancy.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Whether or not zone redundancy is enabled for this container registry. */ +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 a new instance of ZoneRedundancy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ZoneRedundancy() { + } + + /** + * 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); + } + + /** + * Gets known ZoneRedundancy values. + * + * @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/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsCreateSamples.java new file mode 100644 index 0000000000000..3df042efe284b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsCreateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AgentPools Create. */ +public final class AgentPoolsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsCreate.json + */ + /** + * Sample code: AgentPools_Create. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .agentPools() + .define("myAgentPool") + .withRegion("WESTUS") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withCount(1) + .withTier("S1") + .withOs(OS.LINUX) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsDeleteSamples.java new file mode 100644 index 0000000000000..f28805d249f4d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for AgentPools Delete. */ +public final class AgentPoolsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsDelete.json + */ + /** + * Sample code: AgentPools_Delete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.agentPools().delete("myResourceGroup", "myRegistry", "myAgentPool", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsGetQueueStatusSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsGetQueueStatusSamples.java new file mode 100644 index 0000000000000..6d7c7fb6dc0d4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsGetQueueStatusSamples.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.generated; + +/** Samples for AgentPools GetQueueStatus. */ +public final class AgentPoolsGetQueueStatusSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGetQueueStatus.json + */ + /** + * Sample code: AgentPools_GetQueueStatus. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsGetQueueStatus( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .agentPools() + .getQueueStatusWithResponse( + "myResourceGroup", "myRegistry", "myAgentPool", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsGetSamples.java new file mode 100644 index 0000000000000..283c85014746b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for AgentPools Get. */ +public final class AgentPoolsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json + */ + /** + * Sample code: AgentPools_Get. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .agentPools() + .getWithResponse("myResourceGroup", "myRegistry", "myAgentPool", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsListSamples.java new file mode 100644 index 0000000000000..263905d2a794c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for AgentPools List. */ +public final class AgentPoolsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsList.json + */ + /** + * Sample code: AgentPools_List. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.agentPools().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsUpdateSamples.java new file mode 100644 index 0000000000000..0105ef330d8b2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/AgentPoolsUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.AgentPool; + +/** Samples for AgentPools Update. */ +public final class AgentPoolsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsUpdate.json + */ + /** + * Sample code: AgentPools_Update. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void agentPoolsUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + AgentPool resource = + manager + .agentPools() + .getWithResponse("myResourceGroup", "myRegistry", "myAgentPool", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withCount(1).apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsCreateSamples.java new file mode 100644 index 0000000000000..b38edf90c8a4d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ArchiveVersions Create. */ +public final class ArchiveVersionsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionCreate.json + */ + /** + * Sample code: ArchiveVersionCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveVersionCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archiveVersions() + .create( + "myResourceGroup", + "myRegistry", + "rpm", + "myArchiveName", + "myArchiveVersionName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsDeleteSamples.java new file mode 100644 index 0000000000000..e8dacf5551508 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsDeleteSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ArchiveVersions Delete. */ +public final class ArchiveVersionsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionDelete.json + */ + /** + * Sample code: ArchiveVersionDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveVersionDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archiveVersions() + .delete( + "myResourceGroup", + "myRegistry", + "myPackageType", + "myArchiveName", + "myArchiveVersionName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsGetSamples.java new file mode 100644 index 0000000000000..b955fc65930a9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ArchiveVersions Get. */ +public final class ArchiveVersionsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionGet.json + */ + /** + * Sample code: ArchiveVersionGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveVersionGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archiveVersions() + .getWithResponse( + "myResourceGroup", + "myRegistry", + "rpm", + "myArchiveName", + "myArchiveVersionName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsListSamples.java new file mode 100644 index 0000000000000..e856a5a94f3d5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchiveVersionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ArchiveVersions List. */ +public final class ArchiveVersionsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionList.json + */ + /** + * Sample code: ArchiveVersionList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveVersionList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archiveVersions() + .list("myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesCreateSamples.java new file mode 100644 index 0000000000000..a87398d974b09 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesCreateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.ArchivePackageSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PackageSourceType; + +/** Samples for Archives Create. */ +public final class ArchivesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveCreate.json + */ + /** + * Sample code: ArchiveCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archives() + .define("myArchiveName") + .withExistingPackage("myResourceGroup", "myRegistry", "rpm") + .withPackageSource( + new ArchivePackageSourceProperties().withType(PackageSourceType.REMOTE).withUrl("string")) + .withPublishedVersion("string") + .withRepositoryEndpointPrefix("string") + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesDeleteSamples.java new file mode 100644 index 0000000000000..3d6a94b1240fa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesDeleteSamples.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.generated; + +/** Samples for Archives Delete. */ +public final class ArchivesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveDelete.json + */ + /** + * Sample code: ArchiveDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archives() + .delete( + "myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesGetSamples.java new file mode 100644 index 0000000000000..5aed3cd644de2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesGetSamples.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.generated; + +/** Samples for Archives Get. */ +public final class ArchivesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveGet.json + */ + /** + * Sample code: ArchiveGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .archives() + .getWithResponse( + "myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesListSamples.java new file mode 100644 index 0000000000000..fb864498f9c86 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Archives List. */ +public final class ArchivesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveList.json + */ + /** + * Sample code: ArchiveList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.archives().list("myResourceGroup", "myRegistry", "myPackageType", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesUpdateSamples.java new file mode 100644 index 0000000000000..b7264a64b6935 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ArchivesUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.Archive; + +/** Samples for Archives Update. */ +public final class ArchivesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveUpdate.json + */ + /** + * Sample code: ArchiveUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void archiveUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Archive resource = + manager + .archives() + .getWithResponse( + "myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withPublishedVersion("string").apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesCreateSamples.java new file mode 100644 index 0000000000000..a70db7496c8ea --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for CacheRules Create. */ +public final class CacheRulesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleCreate.json + */ + /** + * Sample code: CacheRuleCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void cacheRuleCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .cacheRules() + .define("myCacheRule") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withCredentialSetResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet") + .withSourceRepository("docker.io/library/hello-world") + .withTargetRepository("cached-docker-hub/hello-world") + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesDeleteSamples.java new file mode 100644 index 0000000000000..aeea9fb89cac6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for CacheRules Delete. */ +public final class CacheRulesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleDelete.json + */ + /** + * Sample code: CacheRuleDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void cacheRuleDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.cacheRules().delete("myResourceGroup", "myRegistry", "myCacheRule", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesGetSamples.java new file mode 100644 index 0000000000000..510311a4c8d6e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for CacheRules Get. */ +public final class CacheRulesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleGet.json + */ + /** + * Sample code: CacheRuleGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void cacheRuleGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .cacheRules() + .getWithResponse("myResourceGroup", "myRegistry", "myCacheRule", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesListSamples.java new file mode 100644 index 0000000000000..5249e730b508d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for CacheRules List. */ +public final class CacheRulesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleList.json + */ + /** + * Sample code: CacheRuleList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void cacheRuleList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.cacheRules().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesUpdateSamples.java new file mode 100644 index 0000000000000..342ffd5eb3415 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CacheRulesUpdateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.CacheRule; + +/** Samples for CacheRules Update. */ +public final class CacheRulesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleUpdate.json + */ + /** + * Sample code: CacheRuleUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void cacheRuleUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + CacheRule resource = + manager + .cacheRules() + .getWithResponse("myResourceGroup", "myRegistry", "myCacheRule", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withCredentialSetResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2") + .apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesCreateSamples.java new file mode 100644 index 0000000000000..c3243ecf59652 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesCreateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryMode; +import com.azure.resourcemanager.containerregistry.generated.models.ParentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncProperties; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for ConnectedRegistries Create. */ +public final class ConnectedRegistriesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryCreate.json + */ + /** + * Sample code: ConnectedRegistryCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .define("myConnectedRegistry") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withMode(ConnectedRegistryMode.READ_WRITE) + .withParent( + new ParentProperties() + .withSyncProperties( + new SyncProperties() + .withTokenId("fakeTokenPlaceholder") + .withSchedule("0 9 * * *") + .withSyncWindow(Duration.parse("PT3H")) + .withMessageTtl(Duration.parse("P2D")))) + .withClientTokenIds( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")) + .withNotificationsList(Arrays.asList("hello-world:*:*", "sample/repo/*:1.0:*")) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeactivateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeactivateSamples.java new file mode 100644 index 0000000000000..caa343bbe9c44 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeactivateSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ConnectedRegistries Deactivate. */ +public final class ConnectedRegistriesDeactivateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryDeactivate.json + */ + /** + * Sample code: ConnectedRegistryDeactivate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryDeactivate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .deactivate("myResourceGroup", "myRegistry", "myConnectedRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeleteSamples.java new file mode 100644 index 0000000000000..f40a6ca6314e0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ConnectedRegistries Delete. */ +public final class ConnectedRegistriesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryDelete.json + */ + /** + * Sample code: ConnectedRegistryDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .delete("myResourceGroup", "myRegistry", "myConnectedRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesGetSamples.java new file mode 100644 index 0000000000000..aead7491f9231 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ConnectedRegistries Get. */ +public final class ConnectedRegistriesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryGet.json + */ + /** + * Sample code: ConnectedRegistryGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .getWithResponse("myResourceGroup", "myRegistry", "myConnectedRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesListSamples.java new file mode 100644 index 0000000000000..3ea47a1ab6c9d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ConnectedRegistries List. */ +public final class ConnectedRegistriesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryList.json + */ + /** + * Sample code: ConnectedRegistryList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.connectedRegistries().list("myResourceGroup", "myRegistry", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesUpdateSamples.java new file mode 100644 index 0000000000000..a3cccff12100d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.AuditLogStatus; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistry; +import com.azure.resourcemanager.containerregistry.generated.models.LogLevel; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncUpdateProperties; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for ConnectedRegistries Update. */ +public final class ConnectedRegistriesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryUpdate.json + */ + /** + * Sample code: ConnectedRegistryUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + ConnectedRegistry resource = + manager + .connectedRegistries() + .getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withSyncProperties( + new SyncUpdateProperties() + .withSchedule("0 0 */10 * *") + .withSyncWindow(Duration.parse("P2D")) + .withMessageTtl(Duration.parse("P30D"))) + .withLogging( + new LoggingProperties().withLogLevel(LogLevel.DEBUG).withAuditLogStatus(AuditLogStatus.ENABLED)) + .withClientTokenIds( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token")) + .withNotificationsList(Arrays.asList("hello-world:*:*", "sample/repo/*:1.0:*")) + .apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsCreateSamples.java new file mode 100644 index 0000000000000..bb020ca79dcfd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsCreateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.AuthCredential; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialName; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ResourceIdentityType; +import java.util.Arrays; + +/** Samples for CredentialSets Create. */ +public final class CredentialSetsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetCreate.json + */ + /** + * Sample code: CredentialSetCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void credentialSetCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .credentialSets() + .define("myCredentialSet") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withLoginServer("docker.io") + .withAuthCredentials( + Arrays + .asList( + new AuthCredential() + .withName(CredentialName.CREDENTIAL1) + .withUsernameSecretIdentifier("fakeTokenPlaceholder") + .withPasswordSecretIdentifier("fakeTokenPlaceholder"))) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsDeleteSamples.java new file mode 100644 index 0000000000000..27247f4bfd649 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for CredentialSets Delete. */ +public final class CredentialSetsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetDelete.json + */ + /** + * Sample code: CredentialSetDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void credentialSetDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .credentialSets() + .delete("myResourceGroup", "myRegistry", "myCredentialSet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsGetSamples.java new file mode 100644 index 0000000000000..1a6c464eb823d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for CredentialSets Get. */ +public final class CredentialSetsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetGet.json + */ + /** + * Sample code: CredentialSetGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void credentialSetGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .credentialSets() + .getWithResponse("myResourceGroup", "myRegistry", "myCredentialSet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsListSamples.java new file mode 100644 index 0000000000000..47ac3f16b565c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for CredentialSets List. */ +public final class CredentialSetsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetList.json + */ + /** + * Sample code: CredentialSetList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void credentialSetList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.credentialSets().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsUpdateSamples.java new file mode 100644 index 0000000000000..d60ed91af7b6a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/CredentialSetsUpdateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.AuthCredential; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialName; +import com.azure.resourcemanager.containerregistry.generated.models.CredentialSet; +import java.util.Arrays; + +/** Samples for CredentialSets Update. */ +public final class CredentialSetsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetUpdate.json + */ + /** + * Sample code: CredentialSetUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void credentialSetUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + CredentialSet resource = + manager + .credentialSets() + .getWithResponse("myResourceGroup", "myRegistry", "myCredentialSet", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withAuthCredentials( + Arrays + .asList( + new AuthCredential() + .withName(CredentialName.CREDENTIAL1) + .withUsernameSecretIdentifier("fakeTokenPlaceholder") + .withPasswordSecretIdentifier("fakeTokenPlaceholder"))) + .apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesCreateSamples.java new file mode 100644 index 0000000000000..99af66dd782e9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesCreateSamples.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.generated; + +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.ResourceIdentityType; +import java.util.Arrays; + +/** Samples for ExportPipelines Create. */ +public final class ExportPipelinesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineCreate.json + */ + /** + * Sample code: ExportPipelineCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .exportPipelines() + .define("myExportPipeline") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRegion("westus") + .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withTarget( + new ExportPipelineTargetProperties() + .withType("AzureStorageBlobContainer") + .withUri("https://accountname.blob.core.windows.net/containername") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withOptions(Arrays.asList(PipelineOptions.OVERWRITE_BLOBS)) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesDeleteSamples.java new file mode 100644 index 0000000000000..dae41556bd300 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ExportPipelines Delete. */ +public final class ExportPipelinesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineDelete.json + */ + /** + * Sample code: ExportPipelineDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .exportPipelines() + .delete("myResourceGroup", "myRegistry", "myExportPipeline", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesGetSamples.java new file mode 100644 index 0000000000000..ad8e542bc9e16 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ExportPipelines Get. */ +public final class ExportPipelinesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineGet.json + */ + /** + * Sample code: ExportPipelineGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .exportPipelines() + .getWithResponse("myResourceGroup", "myRegistry", "myExportPipeline", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesListSamples.java new file mode 100644 index 0000000000000..85e7e3e521030 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ExportPipelines List. */ +public final class ExportPipelinesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineList.json + */ + /** + * Sample code: ExportPipelineList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.exportPipelines().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesCreateSamples.java new file mode 100644 index 0000000000000..1c1344fd9e7ad --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesCreateSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +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.PipelineSourceType; +import com.azure.resourcemanager.containerregistry.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerregistry.generated.models.UserIdentityProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ImportPipelines Create. */ +public final class ImportPipelinesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineCreate.json + */ + /** + * Sample code: ImportPipelineCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .importPipelines() + .define("myImportPipeline") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRegion("westus") + .withIdentity( + new IdentityProperties() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentityProperties()))) + .withSource( + new ImportPipelineSourceProperties() + .withType(PipelineSourceType.AZURE_STORAGE_BLOB_CONTAINER) + .withUri("https://accountname.blob.core.windows.net/containername") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withOptions( + Arrays + .asList( + PipelineOptions.OVERWRITE_TAGS, + PipelineOptions.DELETE_SOURCE_BLOB_ON_SUCCESS, + PipelineOptions.CONTINUE_ON_ERRORS)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesDeleteSamples.java new file mode 100644 index 0000000000000..9e17935962034 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ImportPipelines Delete. */ +public final class ImportPipelinesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineDelete.json + */ + /** + * Sample code: ImportPipelineDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .importPipelines() + .delete("myResourceGroup", "myRegistry", "myImportPipeline", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesGetSamples.java new file mode 100644 index 0000000000000..50719023c5ea5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ImportPipelines Get. */ +public final class ImportPipelinesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineGet.json + */ + /** + * Sample code: ImportPipelineGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .importPipelines() + .getWithResponse("myResourceGroup", "myRegistry", "myImportPipeline", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesListSamples.java new file mode 100644 index 0000000000000..2c1614d277a71 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ImportPipelines List. */ +public final class ImportPipelinesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineList.json + */ + /** + * Sample code: ImportPipelineList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.importPipelines().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/OperationsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..1a35aa0e9f440 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/OperationList.json + */ + /** + * Sample code: OperationList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void operationList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsCreateSamples.java new file mode 100644 index 0000000000000..b5f09927df461 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsCreateSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunSourceType; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunTargetType; +import java.util.Arrays; + +/** Samples for PipelineRuns Create. */ +public final class PipelineRunsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunCreate_Import.json + */ + /** + * Sample code: PipelineRunCreate_Import. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunCreateImport( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .define("myPipelineRun") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRequest( + new PipelineRunRequest() + .withPipelineResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline") + .withSource( + new PipelineRunSourceProperties() + .withType(PipelineRunSourceType.AZURE_STORAGE_BLOB) + .withName("myblob.tar.gz")) + .withCatalogDigest("sha256@")) + .withForceUpdateTag("2020-03-04T17:23:21.9261521+00:00") + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunCreate_Export.json + */ + /** + * Sample code: PipelineRunCreate_Export. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunCreateExport( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .define("myPipelineRun") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRequest( + new PipelineRunRequest() + .withPipelineResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline") + .withArtifacts( + Arrays + .asList( + "sourceRepository/hello-world", + "sourceRepository2@sha256:00000000000000000000000000000000000")) + .withTarget( + new PipelineRunTargetProperties() + .withType(PipelineRunTargetType.AZURE_STORAGE_BLOB) + .withName("myblob.tar.gz"))) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsDeleteSamples.java new file mode 100644 index 0000000000000..701f759ae73d4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for PipelineRuns Delete. */ +public final class PipelineRunsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunDelete.json + */ + /** + * Sample code: PipelineRunDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .delete("myResourceGroup", "myRegistry", "myPipelineRun", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsGetSamples.java new file mode 100644 index 0000000000000..9ce18a690af8e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for PipelineRuns Get. */ +public final class PipelineRunsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunGet.json + */ + /** + * Sample code: PipelineRunGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .getWithResponse("myResourceGroup", "myRegistry", "myPipelineRun", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsListSamples.java new file mode 100644 index 0000000000000..b66bd285a1dff --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for PipelineRuns List. */ +public final class PipelineRunsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunList.json + */ + /** + * Sample code: PipelineRunList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.pipelineRuns().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5b821ab029783 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json + */ + /** + * Sample code: PrivateEndpointConnectionCreateOrUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionCreateOrUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .privateEndpointConnections() + .define("myConnection") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(ConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..8258b182bdcd0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: PrivateEndpointConnectionDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .privateEndpointConnections() + .delete("myResourceGroup", "myRegistry", "myConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..a1a476d60d720 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: PrivateEndpointConnectionGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "myRegistry", "myConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..e690b973c5133 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: PrivateEndpointConnectionList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.privateEndpointConnections().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCheckNameAvailabilitySamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..2bd1c6868a581 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCheckNameAvailabilitySamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameCheckRequest; + +/** Samples for Registries CheckNameAvailability. */ +public final class RegistriesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCheckNameAvailable.json + */ + /** + * Sample code: RegistryCheckNameAvailable. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCheckNameAvailable( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .checkNameAvailabilityWithResponse( + new RegistryNameCheckRequest().withName("myRegistry"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCheckNameNotAvailable.json + */ + /** + * Sample code: RegistryCheckNameNotAvailable. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCheckNameNotAvailable( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .checkNameAvailabilityWithResponse( + new RegistryNameCheckRequest().withName("myRegistry"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCreateSamples.java new file mode 100644 index 0000000000000..b87a8b0d1a1f9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCreateSamples.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.SkuName; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries Create. */ +public final class RegistriesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCreateZoneRedundant.json + */ + /** + * Sample code: RegistryCreateZoneRedundant. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCreateZoneRedundant( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .define("myRegistry") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName(SkuName.STANDARD)) + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withZoneRedundancy(ZoneRedundancy.ENABLED) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCreate.json + */ + /** + * Sample code: RegistryCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .define("myRegistry") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName(SkuName.STANDARD)) + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withAdminUserEnabled(true) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesDeleteSamples.java new file mode 100644 index 0000000000000..b2c25fe93640f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Registries Delete. */ +public final class RegistriesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryDelete.json + */ + /** + * Sample code: RegistryDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().delete("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGenerateCredentialsSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGenerateCredentialsSamples.java new file mode 100644 index 0000000000000..811167841be94 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGenerateCredentialsSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import java.time.OffsetDateTime; + +/** Samples for Registries GenerateCredentials. */ +public final class RegistriesGenerateCredentialsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGenerateCredentials.json + */ + /** + * Sample code: RegistryGenerateCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGenerateCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .generateCredentials( + "myResourceGroup", + "myRegistry", + new GenerateCredentialsParameters() + .withTokenId("fakeTokenPlaceholder") + .withExpiry(OffsetDateTime.parse("2020-12-31T15:59:59.0707808Z")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetBuildSourceUploadUrlSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetBuildSourceUploadUrlSamples.java new file mode 100644 index 0000000000000..3557cd6e3325b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetBuildSourceUploadUrlSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Registries GetBuildSourceUploadUrl. */ +public final class RegistriesGetBuildSourceUploadUrlSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json + */ + /** + * Sample code: Registries_GetBuildSourceUploadUrl. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesGetBuildSourceUploadUrl( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .getBuildSourceUploadUrlWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetByResourceGroupSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..0c0f95821cbf8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Registries GetByResourceGroup. */ +public final class RegistriesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGet.json + */ + /** + * Sample code: RegistryGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .getByResourceGroupWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetPrivateLinkResourceSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetPrivateLinkResourceSamples.java new file mode 100644 index 0000000000000..63ef57153e7bf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetPrivateLinkResourceSamples.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.generated; + +/** Samples for Registries GetPrivateLinkResource. */ +public final class RegistriesGetPrivateLinkResourceSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGetPrivateLinkResource.json + */ + /** + * Sample code: RegistryGetPrivateLinkResource. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGetPrivateLinkResource( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .getPrivateLinkResourceWithResponse( + "myResourceGroup", "myRegistry", "registry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesImportImageSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesImportImageSamples.java new file mode 100644 index 0000000000000..48f55ef1f5216 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesImportImageSamples.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ImportMode; +import com.azure.resourcemanager.containerregistry.generated.models.ImportSource; +import java.util.Arrays; + +/** Samples for Registries ImportImage. */ +public final class RegistriesImportImageSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageFromPublicRegistry.json + */ + /** + * Sample code: ImportImageFromPublicRegistry. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageFromPublicRegistry( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withRegistryUri("registry.hub.docker.com") + .withSourceImage("library/hello-world")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageByTag.json + */ + /** + * Sample code: ImportImageByTag. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageByTag( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withResourceId( + "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry") + .withSourceImage("sourceRepository:sourceTag")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageByManifestDigest.json + */ + /** + * Sample code: ImportImageByManifestDigest. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageByManifestDigest( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withResourceId( + "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry") + .withSourceImage( + "sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListByResourceGroupSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ba8a849e2f62d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Registries ListByResourceGroup. */ +public final class RegistriesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListByResourceGroup.json + */ + /** + * Sample code: RegistryListByResourceGroup. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListByResourceGroup( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListCredentialsSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListCredentialsSamples.java new file mode 100644 index 0000000000000..f8d664e524eb3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListCredentialsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Registries ListCredentials. */ +public final class RegistriesListCredentialsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListCredentials.json + */ + /** + * Sample code: RegistryListCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .listCredentialsWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListPrivateLinkResourcesSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListPrivateLinkResourcesSamples.java new file mode 100644 index 0000000000000..f8e5ca1680293 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListPrivateLinkResourcesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Registries ListPrivateLinkResources. */ +public final class RegistriesListPrivateLinkResourcesSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListPrivateLinkResources.json + */ + /** + * Sample code: RegistryListPrivateLinkResources. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListPrivateLinkResources( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .listPrivateLinkResources("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListSamples.java new file mode 100644 index 0000000000000..423bb08e51a8e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Registries List. */ +public final class RegistriesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryList.json + */ + /** + * Sample code: RegistryList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListUsagesSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListUsagesSamples.java new file mode 100644 index 0000000000000..2e7904c27b9ed --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListUsagesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Registries ListUsages. */ +public final class RegistriesListUsagesSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListUsages.json + */ + /** + * Sample code: RegistryListUsages. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListUsages( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listUsagesWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesRegenerateCredentialSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesRegenerateCredentialSamples.java new file mode 100644 index 0000000000000..a49c1a450c163 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesRegenerateCredentialSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.PasswordName; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; + +/** Samples for Registries RegenerateCredential. */ +public final class RegistriesRegenerateCredentialSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryRegenerateCredential.json + */ + /** + * Sample code: RegistryRegenerateCredential. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryRegenerateCredential( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .regenerateCredentialWithResponse( + "myResourceGroup", + "myRegistry", + new RegenerateCredentialParameters().withName(PasswordName.PASSWORD), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesScheduleRunSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesScheduleRunSamples.java new file mode 100644 index 0000000000000..86af2ba2c2858 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesScheduleRunSamples.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.Architecture; +import com.azure.resourcemanager.containerregistry.generated.models.Argument; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.CustomRegistryCredentials; +import com.azure.resourcemanager.containerregistry.generated.models.DockerBuildRequest; +import com.azure.resourcemanager.containerregistry.generated.models.EncodedTaskRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.FileTaskRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.OverrideTaskStepProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SecretObject; +import com.azure.resourcemanager.containerregistry.generated.models.SecretObjectType; +import com.azure.resourcemanager.containerregistry.generated.models.SetValue; +import com.azure.resourcemanager.containerregistry.generated.models.SourceRegistryCredentials; +import com.azure.resourcemanager.containerregistry.generated.models.SourceRegistryLoginMode; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRunRequest; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries ScheduleRun. */ +public final class RegistriesScheduleRunSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json + */ + /** + * Sample code: Registries_ScheduleRun_FileTaskRun. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunFileTaskRun( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new FileTaskRunRequest() + .withTaskFilePath("acb.yaml") + .withValuesFilePath("prod-values.yaml") + .withValues( + Arrays + .asList( + new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new SetValue() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withSourceLocation( + "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun.json + */ + /** + * Sample code: Registries_ScheduleRun. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRun( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new DockerBuildRequest() + .withIsArchiveEnabled(true) + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(true) + .withDockerFilePath("DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withSourceLocation( + "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json + */ + /** + * Sample code: Registries_ScheduleRun_EncodedTaskRun. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunEncodedTaskRun( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new EncodedTaskRunRequest() + .withEncodedTaskContent("fakeTokenPlaceholder") + .withEncodedValuesContent("fakeTokenPlaceholder") + .withValues( + Arrays + .asList( + new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new SetValue() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX)) + .withAgentConfiguration(new AgentProperties().withCpu(2)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json + */ + /** + * Sample code: Registries_ScheduleRun_WithCustomCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunWithCustomCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new DockerBuildRequest() + .withIsArchiveEnabled(true) + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(true) + .withDockerFilePath("DockerFile") + .withTarget("stage1") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withSourceLocation( + "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D") + .withCredentials( + new Credentials() + .withSourceRegistry( + new SourceRegistryCredentials().withLoginMode(SourceRegistryLoginMode.DEFAULT)) + .withCustomRegistries( + mapOf( + "myregistry.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject().withValue("reg1").withType(SecretObjectType.OPAQUE)) + .withPassword( + new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE)), + "myregistry2.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject().withValue("reg2").withType(SecretObjectType.OPAQUE)) + .withPassword( + new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json + */ + /** + * Sample code: Registries_ScheduleRun_WithLogTemplate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunWithLogTemplate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new DockerBuildRequest() + .withIsArchiveEnabled(true) + .withLogTemplate("acr/tasks:{{.Run.OS}}") + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(true) + .withDockerFilePath("DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withSourceLocation( + "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_Task.json + */ + /** + * Sample code: Registries_ScheduleRun_Task. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunTask( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new TaskRunRequest() + .withTaskId("myTask") + .withOverrideTaskStepProperties( + new OverrideTaskStepProperties() + .withFile("overriddenDockerfile") + .withArguments( + Arrays + .asList( + new Argument() + .withName("mytestargument") + .withValue("mytestvalue") + .withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withTarget("build") + .withValues( + Arrays + .asList( + new SetValue() + .withName("mytestname") + .withValue("mytestvalue") + .withIsSecret(false), + new SetValue() + .withName("mysecrettestname") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withUpdateTriggerToken("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json + */ + /** + * Sample code: Registries_ScheduleRun_Task_WithCustomCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registriesScheduleRunTaskWithCustomCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .scheduleRun( + "myResourceGroup", + "myRegistry", + new FileTaskRunRequest() + .withTaskFilePath("acb.yaml") + .withValues( + Arrays + .asList( + new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new SetValue() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true))) + .withPlatform(new PlatformProperties().withOs(OS.LINUX)) + .withCredentials( + new Credentials() + .withSourceRegistry( + new SourceRegistryCredentials().withLoginMode(SourceRegistryLoginMode.DEFAULT)) + .withCustomRegistries( + mapOf( + "myregistry.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject().withValue("reg1").withType(SecretObjectType.OPAQUE)) + .withPassword( + new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesUpdateSamples.java new file mode 100644 index 0000000000000..c91f6c85a226a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.Registry; +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.SkuName; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries Update. */ +public final class RegistriesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryUpdate.json + */ + /** + * Sample code: RegistryUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Registry resource = + manager + .registries() + .getByResourceGroupWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withSku(new Sku().withName(SkuName.STANDARD)) + .withAdminUserEnabled(true) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsCreateSamples.java new file mode 100644 index 0000000000000..520ec8ec9deab --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsCreateSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Replications Create. */ +public final class ReplicationsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationCreate.json + */ + /** + * Sample code: ReplicationCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .define("myReplication") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationCreateZoneRedundant.json + */ + /** + * Sample code: ReplicationCreateZoneRedundant. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationCreateZoneRedundant( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .define("myReplication") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withRegionEndpointEnabled(true) + .withZoneRedundancy(ZoneRedundancy.ENABLED) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsDeleteSamples.java new file mode 100644 index 0000000000000..9e05486b082f1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Replications Delete. */ +public final class ReplicationsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationDelete.json + */ + /** + * Sample code: ReplicationDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .delete("myResourceGroup", "myRegistry", "myReplication", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsGetSamples.java new file mode 100644 index 0000000000000..12b1c1d8105c5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Replications Get. */ +public final class ReplicationsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationGet.json + */ + /** + * Sample code: ReplicationGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .getWithResponse("myResourceGroup", "myRegistry", "myReplication", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsListSamples.java new file mode 100644 index 0000000000000..26f5d9c93c9b6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Replications List. */ +public final class ReplicationsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationList.json + */ + /** + * Sample code: ReplicationList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.replications().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsUpdateSamples.java new file mode 100644 index 0000000000000..dbae912447aa4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.Replication; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Replications Update. */ +public final class ReplicationsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationUpdate.json + */ + /** + * Sample code: ReplicationUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Replication resource = + manager + .replications() + .getWithResponse("myResourceGroup", "myRegistry", "myReplication", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsCancelSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsCancelSamples.java new file mode 100644 index 0000000000000..d10b50a50e32e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsCancelSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Runs Cancel. */ +public final class RunsCancelSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsCancel.json + */ + /** + * Sample code: Runs_Cancel. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void runsCancel( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .runs() + .cancel( + "myResourceGroup", + "myRegistry", + "0accec26-d6de-4757-8e74-d080f38eaaab", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsGetLogSasUrlSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsGetLogSasUrlSamples.java new file mode 100644 index 0000000000000..340ed4ed50c1e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsGetLogSasUrlSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Runs GetLogSasUrl. */ +public final class RunsGetLogSasUrlSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGetLogSasUrl.json + */ + /** + * Sample code: Runs_GetLogSasUrl. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void runsGetLogSasUrl( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .runs() + .getLogSasUrlWithResponse( + "myResourceGroup", + "myRegistry", + "0accec26-d6de-4757-8e74-d080f38eaaab", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsGetSamples.java new file mode 100644 index 0000000000000..1a958fc341e43 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsGetSamples.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.generated; + +/** Samples for Runs Get. */ +public final class RunsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json + */ + /** + * Sample code: Runs_Get. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void runsGet(com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .runs() + .getWithResponse( + "myResourceGroup", + "myRegistry", + "0accec26-d6de-4757-8e74-d080f38eaaab", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsListSamples.java new file mode 100644 index 0000000000000..f63f7606d83bb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Runs List. */ +public final class RunsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsList.json + */ + /** + * Sample code: Runs_List. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void runsList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.runs().list("myResourceGroup", "myRegistry", "", 10, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsUpdateSamples.java new file mode 100644 index 0000000000000..d1a7a96cf0d90 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RunsUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.RunUpdateParameters; + +/** Samples for Runs Update. */ +public final class RunsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsUpdate.json + */ + /** + * Sample code: Runs_Update. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void runsUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .runs() + .update( + "myResourceGroup", + "myRegistry", + "0accec26-d6de-4757-8e74-d080f38eaaab", + new RunUpdateParameters().withIsArchiveEnabled(true), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsCreateSamples.java new file mode 100644 index 0000000000000..46d6531b13359 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import java.util.Arrays; + +/** Samples for ScopeMaps Create. */ +public final class ScopeMapsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapCreate.json + */ + /** + * Sample code: ScopeMapCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .scopeMaps() + .define("myScopeMap") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withDescription("Developer Scopes") + .withActions(Arrays.asList("repositories/myrepository/contentWrite", "repositories/myrepository/delete")) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsDeleteSamples.java new file mode 100644 index 0000000000000..061f09d88ec35 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ScopeMaps Delete. */ +public final class ScopeMapsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapDelete.json + */ + /** + * Sample code: ScopeMapDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.scopeMaps().delete("myResourceGroup", "myRegistry", "myScopeMap", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsGetSamples.java new file mode 100644 index 0000000000000..beac693f86178 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ScopeMaps Get. */ +public final class ScopeMapsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapGet.json + */ + /** + * Sample code: ScopeMapGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .scopeMaps() + .getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsListSamples.java new file mode 100644 index 0000000000000..07598b92ded15 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for ScopeMaps List. */ +public final class ScopeMapsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapList.json + */ + /** + * Sample code: ScopeMapList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.scopeMaps().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsUpdateSamples.java new file mode 100644 index 0000000000000..71b86a48b4680 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsUpdateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMap; +import java.util.Arrays; + +/** Samples for ScopeMaps Update. */ +public final class ScopeMapsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapUpdate.json + */ + /** + * Sample code: ScopeMapUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + ScopeMap resource = + manager + .scopeMaps() + .getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withDescription("Developer Scopes") + .withActions( + Arrays.asList("repositories/myrepository/contentWrite", "repositories/myrepository/contentRead")) + .apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsCreateSamples.java new file mode 100644 index 0000000000000..88a3ef5481d82 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsCreateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.Architecture; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.EncodedTaskRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import java.util.Arrays; + +/** Samples for TaskRuns Create. */ +public final class TaskRunsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsCreate.json + */ + /** + * Sample code: TaskRuns_Create. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .taskRuns() + .define("myRun") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRunRequest( + new EncodedTaskRunRequest() + .withEncodedTaskContent("fakeTokenPlaceholder") + .withEncodedValuesContent("fakeTokenPlaceholder") + .withValues(Arrays.asList()) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withCredentials(new Credentials())) + .withForceUpdateTag("test") + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsDeleteSamples.java new file mode 100644 index 0000000000000..6fc95b863e0c0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for TaskRuns Delete. */ +public final class TaskRunsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsDelete.json + */ + /** + * Sample code: TaskRuns_Delete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.taskRuns().delete("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsGetDetailsSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsGetDetailsSamples.java new file mode 100644 index 0000000000000..5a0c3b336a58c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsGetDetailsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for TaskRuns GetDetails. */ +public final class TaskRunsGetDetailsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGetDetails.json + */ + /** + * Sample code: TaskRuns_GetDetails. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsGetDetails( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .taskRuns() + .getDetailsWithResponse("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsGetSamples.java new file mode 100644 index 0000000000000..423980b5b42ab --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for TaskRuns Get. */ +public final class TaskRunsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json + */ + /** + * Sample code: TaskRuns_Get. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.taskRuns().getWithResponse("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsListSamples.java new file mode 100644 index 0000000000000..d0f70ad99e6ac --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for TaskRuns List. */ +public final class TaskRunsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsList.json + */ + /** + * Sample code: TaskRuns_List. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.taskRuns().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsUpdateSamples.java new file mode 100644 index 0000000000000..043cc8d6b6a8f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TaskRunsUpdateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.Architecture; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.EncodedTaskRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TaskRun; +import java.util.Arrays; + +/** Samples for TaskRuns Update. */ +public final class TaskRunsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsUpdate.json + */ + /** + * Sample code: TaskRuns_Update. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void taskRunsUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + TaskRun resource = + manager + .taskRuns() + .getWithResponse("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withRunRequest( + new EncodedTaskRunRequest() + .withIsArchiveEnabled(true) + .withEncodedTaskContent("fakeTokenPlaceholder") + .withEncodedValuesContent("fakeTokenPlaceholder") + .withValues(Arrays.asList()) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withCredentials(new Credentials())) + .withForceUpdateTag("test") + .apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksCreateSamples.java new file mode 100644 index 0000000000000..6fa5bfae324fa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksCreateSamples.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.Architecture; +import com.azure.resourcemanager.containerregistry.generated.models.Argument; +import com.azure.resourcemanager.containerregistry.generated.models.AuthInfo; +import com.azure.resourcemanager.containerregistry.generated.models.BaseImageTrigger; +import com.azure.resourcemanager.containerregistry.generated.models.BaseImageTriggerType; +import com.azure.resourcemanager.containerregistry.generated.models.DockerTaskStep; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.OS; +import com.azure.resourcemanager.containerregistry.generated.models.PlatformProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerregistry.generated.models.SourceControlType; +import com.azure.resourcemanager.containerregistry.generated.models.SourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SourceTrigger; +import com.azure.resourcemanager.containerregistry.generated.models.SourceTriggerEvent; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStatus; +import com.azure.resourcemanager.containerregistry.generated.models.TimerTrigger; +import com.azure.resourcemanager.containerregistry.generated.models.TokenType; +import com.azure.resourcemanager.containerregistry.generated.models.TriggerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.UpdateTriggerPayloadType; +import com.azure.resourcemanager.containerregistry.generated.models.UserIdentityProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Tasks Create. */ +public final class TasksCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json + */ + /** + * Sample code: Tasks_Create_WithUserIdentities_WithSystemIdentity. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksCreateWithUserIdentitiesWithSystemIdentity( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .define("mytTask") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withStatus(TaskStatus.ENABLED) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withStep( + new DockerTaskStep() + .withContextPath("src") + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(false) + .withDockerFilePath("src/DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true)))) + .withTrigger( + new TriggerProperties() + .withTimerTriggers( + Arrays.asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) + .withSourceTriggers( + Arrays + .asList( + new SourceTrigger() + .withSourceRepository( + new SourceProperties() + .withSourceControlType(SourceControlType.GITHUB) + .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") + .withBranch("master") + .withSourceControlAuthProperties( + new AuthInfo() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger"))) + .withBaseImageTrigger( + new BaseImageTrigger() + .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) + .withName("myBaseImageTrigger"))) + .withIsSystemTask(false) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate.json + */ + /** + * Sample code: Tasks_Create. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .define("mytTask") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withStatus(TaskStatus.ENABLED) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withStep( + new DockerTaskStep() + .withContextPath("src") + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(false) + .withDockerFilePath("src/DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true)))) + .withTrigger( + new TriggerProperties() + .withTimerTriggers( + Arrays.asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) + .withSourceTriggers( + Arrays + .asList( + new SourceTrigger() + .withSourceRepository( + new SourceProperties() + .withSourceControlType(SourceControlType.GITHUB) + .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") + .withBranch("master") + .withSourceControlAuthProperties( + new AuthInfo() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger"))) + .withBaseImageTrigger( + new BaseImageTrigger() + .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) + .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo") + .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.TOKEN) + .withName("myBaseImageTrigger"))) + .withLogTemplate("acr/tasks:{{.Run.OS}}") + .withIsSystemTask(false) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json + */ + /** + * Sample code: Tasks_Create_WithSystemAndUserIdentities. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksCreateWithSystemAndUserIdentities( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .define("mytTask") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withIdentity( + new IdentityProperties() + .withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentityProperties()))) + .withStatus(TaskStatus.ENABLED) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withStep( + new DockerTaskStep() + .withContextPath("src") + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(false) + .withDockerFilePath("src/DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true)))) + .withTrigger( + new TriggerProperties() + .withTimerTriggers( + Arrays.asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) + .withSourceTriggers( + Arrays + .asList( + new SourceTrigger() + .withSourceRepository( + new SourceProperties() + .withSourceControlType(SourceControlType.GITHUB) + .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") + .withBranch("master") + .withSourceControlAuthProperties( + new AuthInfo() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger"))) + .withBaseImageTrigger( + new BaseImageTrigger() + .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) + .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo") + .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.DEFAULT) + .withName("myBaseImageTrigger"))) + .withIsSystemTask(false) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json + */ + /** + * Sample code: Tasks_Create_WithUserIdentities. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksCreateWithUserIdentities( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .define("mytTask") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withIdentity( + new IdentityProperties() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new UserIdentityProperties(), + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentityProperties()))) + .withStatus(TaskStatus.ENABLED) + .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) + .withAgentConfiguration(new AgentProperties().withCpu(2)) + .withStep( + new DockerTaskStep() + .withContextPath("src") + .withImageNames(Arrays.asList("azurerest:testtag")) + .withIsPushEnabled(true) + .withNoCache(false) + .withDockerFilePath("src/DockerFile") + .withArguments( + Arrays + .asList( + new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), + new Argument() + .withName("mysecrettestargument") + .withValue("mysecrettestvalue") + .withIsSecret(true)))) + .withTrigger( + new TriggerProperties() + .withTimerTriggers( + Arrays.asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) + .withSourceTriggers( + Arrays + .asList( + new SourceTrigger() + .withSourceRepository( + new SourceProperties() + .withSourceControlType(SourceControlType.GITHUB) + .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") + .withBranch("master") + .withSourceControlAuthProperties( + new AuthInfo() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger"))) + .withBaseImageTrigger( + new BaseImageTrigger() + .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) + .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo") + .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.DEFAULT) + .withName("myBaseImageTrigger"))) + .withIsSystemTask(false) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate_QuickTask.json + */ + /** + * Sample code: Tasks_Create_QuickTask. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksCreateQuickTask( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .define("quicktask") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withLogTemplate("acr/tasks:{{.Run.OS}}") + .withIsSystemTask(true) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksDeleteSamples.java new file mode 100644 index 0000000000000..0699c7946eabd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Tasks Delete. */ +public final class TasksDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksDelete.json + */ + /** + * Sample code: Tasks_Delete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tasks().delete("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksGetDetailsSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksGetDetailsSamples.java new file mode 100644 index 0000000000000..574645356405f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksGetDetailsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Tasks GetDetails. */ +public final class TasksGetDetailsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGetDetails.json + */ + /** + * Sample code: Tasks_GetDetails. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksGetDetails( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tasks() + .getDetailsWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksGetSamples.java new file mode 100644 index 0000000000000..09f0f2ae9a7a6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Tasks Get. */ +public final class TasksGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json + */ + /** + * Sample code: Tasks_Get. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tasks().getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksListSamples.java new file mode 100644 index 0000000000000..7b141db976025 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Tasks List. */ +public final class TasksListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksList.json + */ + /** + * Sample code: Tasks_List. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tasks().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksUpdateSamples.java new file mode 100644 index 0000000000000..5a82d5cf00c87 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TasksUpdateSamples.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.AgentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.AuthInfoUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Credentials; +import com.azure.resourcemanager.containerregistry.generated.models.CustomRegistryCredentials; +import com.azure.resourcemanager.containerregistry.generated.models.DockerBuildStepUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.SecretObject; +import com.azure.resourcemanager.containerregistry.generated.models.SecretObjectType; +import com.azure.resourcemanager.containerregistry.generated.models.SourceTriggerEvent; +import com.azure.resourcemanager.containerregistry.generated.models.SourceTriggerUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.SourceUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Task; +import com.azure.resourcemanager.containerregistry.generated.models.TaskStatus; +import com.azure.resourcemanager.containerregistry.generated.models.TokenType; +import com.azure.resourcemanager.containerregistry.generated.models.TriggerUpdateParameters; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Tasks Update. */ +public final class TasksUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_QuickTask.json + */ + /** + * Sample code: Tasks_Update_QuickTask. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksUpdateQuickTask( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Task resource = + manager + .tasks() + .getWithResponse("myResourceGroup", "myRegistry", "quicktask", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withLogTemplate("acr/tasks:{{.Run.OS}}") + .apply(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json + */ + /** + * Sample code: Tasks_Update_WithMSICustomCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksUpdateWithMSICustomCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Task resource = + manager + .tasks() + .getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withAgentConfiguration(new AgentProperties().withCpu(3)) + .withStep( + new DockerBuildStepUpdateParameters() + .withImageNames(Arrays.asList("azurerest:testtag1")) + .withDockerFilePath("src/DockerFile")) + .withTrigger( + new TriggerUpdateParameters() + .withSourceTriggers( + Arrays + .asList( + new SourceTriggerUpdateParameters() + .withSourceRepository( + new SourceUpdateParameters() + .withSourceControlAuthProperties( + new AuthInfoUpdateParameters() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger")))) + .withCredentials( + new Credentials() + .withCustomRegistries( + mapOf("myregistry.azurecr.io", new CustomRegistryCredentials().withIdentity("[system]")))) + .apply(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json + */ + /** + * Sample code: Tasks_Update_WithKeyVaultCustomCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksUpdateWithKeyVaultCustomCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Task resource = + manager + .tasks() + .getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withAgentConfiguration(new AgentProperties().withCpu(3)) + .withStep( + new DockerBuildStepUpdateParameters() + .withImageNames(Arrays.asList("azurerest:testtag1")) + .withDockerFilePath("src/DockerFile")) + .withTrigger( + new TriggerUpdateParameters() + .withSourceTriggers( + Arrays + .asList( + new SourceTriggerUpdateParameters() + .withSourceRepository( + new SourceUpdateParameters() + .withSourceControlAuthProperties( + new AuthInfoUpdateParameters() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger")))) + .withCredentials( + new Credentials() + .withCustomRegistries( + mapOf( + "myregistry.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject() + .withValue("https://myacbvault.vault.azure.net/secrets/username") + .withType(SecretObjectType.VAULTSECRET)) + .withPassword( + new SecretObject() + .withValue("https://myacbvault.vault.azure.net/secrets/password") + .withType(SecretObjectType.VAULTSECRET)) + .withIdentity("[system]")))) + .apply(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate.json + */ + /** + * Sample code: Tasks_Update. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Task resource = + manager + .tasks() + .getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withAgentConfiguration(new AgentProperties().withCpu(3)) + .withStep( + new DockerBuildStepUpdateParameters() + .withImageNames(Arrays.asList("azurerest:testtag1")) + .withDockerFilePath("src/DockerFile")) + .withTrigger( + new TriggerUpdateParameters() + .withSourceTriggers( + Arrays + .asList( + new SourceTriggerUpdateParameters() + .withSourceRepository( + new SourceUpdateParameters() + .withSourceControlAuthProperties( + new AuthInfoUpdateParameters() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger")))) + .withCredentials( + new Credentials() + .withCustomRegistries( + mapOf( + "myregistry.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject().withValue("username").withType(SecretObjectType.OPAQUE)) + .withPassword( + new SecretObject() + .withValue("https://myacbvault.vault.azure.net/secrets/password") + .withType(SecretObjectType.VAULTSECRET)) + .withIdentity("[system]")))) + .withLogTemplate("acr/tasks:{{.Run.OS}}") + .apply(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json + */ + /** + * Sample code: Tasks_Update_WithOpaqueCustomCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tasksUpdateWithOpaqueCustomCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Task resource = + manager + .tasks() + .getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withStatus(TaskStatus.ENABLED) + .withAgentConfiguration(new AgentProperties().withCpu(3)) + .withStep( + new DockerBuildStepUpdateParameters() + .withImageNames(Arrays.asList("azurerest:testtag1")) + .withDockerFilePath("src/DockerFile")) + .withTrigger( + new TriggerUpdateParameters() + .withSourceTriggers( + Arrays + .asList( + new SourceTriggerUpdateParameters() + .withSourceRepository( + new SourceUpdateParameters() + .withSourceControlAuthProperties( + new AuthInfoUpdateParameters() + .withTokenType(TokenType.PAT) + .withToken("fakeTokenPlaceholder"))) + .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) + .withName("mySourceTrigger")))) + .withCredentials( + new Credentials() + .withCustomRegistries( + mapOf( + "myregistry.azurecr.io", + new CustomRegistryCredentials() + .withUsername( + new SecretObject().withValue("username").withType(SecretObjectType.OPAQUE)) + .withPassword(new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensCreateSamples.java new file mode 100644 index 0000000000000..631ee65afd524 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensCreateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificate; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificateName; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import java.util.Arrays; + +/** Samples for Tokens Create. */ +public final class TokensCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenCreate.json + */ + /** + * Sample code: TokenCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tokens() + .define("myToken") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withScopeMapId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap") + .withCredentials( + new TokenCredentialsProperties() + .withCertificates( + Arrays + .asList( + new TokenCertificate() + .withName(TokenCertificateName.CERTIFICATE1) + .withEncodedPemCertificate("fakeTokenPlaceholder")))) + .withStatus(TokenStatus.DISABLED) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensDeleteSamples.java new file mode 100644 index 0000000000000..c829639232f81 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Tokens Delete. */ +public final class TokensDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenDelete.json + */ + /** + * Sample code: TokenDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().delete("myResourceGroup", "myRegistry", "myToken", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensGetSamples.java new file mode 100644 index 0000000000000..c243fdb569f95 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Tokens Get. */ +public final class TokensGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenGet.json + */ + /** + * Sample code: TokenGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().getWithResponse("myResourceGroup", "myRegistry", "myToken", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensListSamples.java new file mode 100644 index 0000000000000..9f080e4d64836 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Tokens List. */ +public final class TokensListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenList.json + */ + /** + * Sample code: TokenList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensUpdateSamples.java new file mode 100644 index 0000000000000..a8ff623aa4c83 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensUpdateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.Token; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificate; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificateName; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import java.util.Arrays; + +/** Samples for Tokens Update. */ +public final class TokensUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenUpdate.json + */ + /** + * Sample code: TokenUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Token resource = + manager + .tokens() + .getWithResponse("myResourceGroup", "myRegistry", "myToken", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withScopeMapId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap") + .withCredentials( + new TokenCredentialsProperties() + .withCertificates( + Arrays + .asList( + new TokenCertificate() + .withName(TokenCertificateName.CERTIFICATE1) + .withEncodedPemCertificate("fakeTokenPlaceholder")))) + .apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksCreateSamples.java new file mode 100644 index 0000000000000..5a06640183e4b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksCreateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Webhooks Create. */ +public final class WebhooksCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookCreate.json + */ + /** + * Sample code: WebhookCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .webhooks() + .define("myWebhook") + .withRegion("westus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withServiceUri("http://myservice.com") + .withCustomHeaders(mapOf("Authorization", "fakeTokenPlaceholder")) + .withStatus(WebhookStatus.ENABLED) + .withScope("myRepository") + .withActions(Arrays.asList(WebhookAction.PUSH)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksDeleteSamples.java new file mode 100644 index 0000000000000..80ea8be6f5979 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Webhooks Delete. */ +public final class WebhooksDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookDelete.json + */ + /** + * Sample code: WebhookDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().delete("myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetCallbackConfigSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetCallbackConfigSamples.java new file mode 100644 index 0000000000000..f3ab7c4ad0003 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetCallbackConfigSamples.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.generated; + +/** Samples for Webhooks GetCallbackConfig. */ +public final class WebhooksGetCallbackConfigSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookGetCallbackConfig.json + */ + /** + * Sample code: WebhookGetCallbackConfig. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookGetCallbackConfig( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .webhooks() + .getCallbackConfigWithResponse( + "myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetSamples.java new file mode 100644 index 0000000000000..f5cf6b59346f5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Webhooks Get. */ +public final class WebhooksGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookGet.json + */ + /** + * Sample code: WebhookGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .webhooks() + .getWithResponse("myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListEventsSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListEventsSamples.java new file mode 100644 index 0000000000000..33c4230e9b1c7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListEventsSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Webhooks ListEvents. */ +public final class WebhooksListEventsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookListEvents.json + */ + /** + * Sample code: WebhookListEvents. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookListEvents( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().listEvents("myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListSamples.java new file mode 100644 index 0000000000000..71b66dcf7b7eb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Webhooks List. */ +public final class WebhooksListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookList.json + */ + /** + * Sample code: WebhookList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksPingSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksPingSamples.java new file mode 100644 index 0000000000000..6d11d09e2fc02 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksPingSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +/** Samples for Webhooks Ping. */ +public final class WebhooksPingSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookPing.json + */ + /** + * Sample code: WebhookPing. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookPing( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .webhooks() + .pingWithResponse("myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksUpdateSamples.java new file mode 100644 index 0000000000000..bdf357e6eebc1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksUpdateSamples.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.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.Webhook; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Webhooks Update. */ +public final class WebhooksUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookUpdate.json + */ + /** + * Sample code: WebhookUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Webhook resource = + manager + .webhooks() + .getWithResponse("myResourceGroup", "myRegistry", "myWebhook", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withServiceUri("http://myservice.com") + .withCustomHeaders(mapOf("Authorization", "fakeTokenPlaceholder")) + .withStatus(WebhookStatus.ENABLED) + .withScope("myRepository") + .withActions(Arrays.asList(WebhookAction.PUSH)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/ci.yml b/sdk/containerregistry/ci.yml index 3ce2ba30b47e7..85477acdf5cdf 100644 --- a/sdk/containerregistry/ci.yml +++ b/sdk/containerregistry/ci.yml @@ -34,10 +34,14 @@ pr: - sdk/containerregistry/azure-containers-containerregistry-perf/pom.xml parameters: -- name: release_dependsonlivetests - displayName: 'Release depends on live tests' - type: boolean - default: true + - name: release_dependsonlivetests + displayName: Release depends on live tests + type: boolean + default: true + - name: release_azureresourcemanagercontainerregistrygenerated + displayName: azure-resourcemanager-containerregistry-generated + type: boolean + default: false extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -48,9 +52,12 @@ extends: - name: azure-containers-containerregistry groupId: com.azure safeName: azurecontainerscontainerregistry + - name: azure-resourcemanager-containerregistry-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercontainerregistrygenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagercontainerregistrygenerated }} AdditionalModules: - name: azure-containers-containerregistry-perf groupId: com.azure - # required by the above perf library - name: perf-test-core groupId: com.azure diff --git a/sdk/containerregistry/pom.xml b/sdk/containerregistry/pom.xml index 55124e915d154..a333c3bb51a57 100644 --- a/sdk/containerregistry/pom.xml +++ b/sdk/containerregistry/pom.xml @@ -11,5 +11,6 @@ azure-containers-containerregistry azure-containers-containerregistry-perf + azure-resourcemanager-containerregistry-generated