diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/CHANGELOG.md b/sdk/containerregistry/azure-mgmt-containerregistry/CHANGELOG.md index 4630f584713a..be0b9d04a517 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/CHANGELOG.md +++ b/sdk/containerregistry/azure-mgmt-containerregistry/CHANGELOG.md @@ -1,5 +1,23 @@ # Release History +## 15.1.0 (2026-11-20) + +### Features Added + + - Model `NetworkRuleSet` added property `virtual_network_rules` + - Model `RegistryProperties` added property `endpoint_protocol` + - Model `RegistryProperties` added property `regional_endpoint_host_names` + - Model `RegistryProperties` added property `regional_endpoints` + - Model `RegistryPropertiesUpdateParameters` added property `endpoint_protocol` + - Model `RegistryPropertiesUpdateParameters` added property `regional_endpoints` + - Added enum `EndpointProtocol` + - Added enum `RegionalEndpoints` + - Added model `VirtualNetworkRule` + +### Breaking Changes + + - Model `SyncProperties` property `token_id` (JSON `tokenId`) is no longer required and is now `Optional[str]` with constructor default `None`; type-checked readers may need to handle `None`. + ## 15.1.0b4 (2026-11-11) ### Features Added diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/_metadata.json b/sdk/containerregistry/azure-mgmt-containerregistry/_metadata.json index ef238b03bf90..c5385d924280 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/_metadata.json +++ b/sdk/containerregistry/azure-mgmt-containerregistry/_metadata.json @@ -1,11 +1,11 @@ { - "apiVersion": "2026-10-15-preview", + "apiVersion": "2026-11-01", "apiVersions": { - "Microsoft.ContainerRegistry": "2026-10-15-preview" + "Microsoft.ContainerRegistry": "2026-11-01" }, - "commit": "939d1a81ec5159e61394cd8ca2589c2c0ce49ccd", + "commit": "6482a1641d3d8568a0314ece4244119aee68ab27", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry", - "emitterVersion": "0.63.11", - "httpClientPythonVersion": "0.40.0" + "emitterVersion": "0.63.12", + "httpClientPythonVersion": "0.40.1" } \ No newline at end of file diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/api.md b/sdk/containerregistry/azure-mgmt-containerregistry/api.md index 1ec681d83056..fce314da0261 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/api.md +++ b/sdk/containerregistry/azure-mgmt-containerregistry/api.md @@ -2,15 +2,10 @@ namespace azure.mgmt.containerregistry class azure.mgmt.containerregistry.ContainerRegistryManagementClient: implements ContextManager - archive_versions: ArchiveVersionsOperations - archives: ArchivesOperations cache_rules: CacheRulesOperations connected_registries: ConnectedRegistriesOperations credential_sets: CredentialSetsOperations - export_pipelines: ExportPipelinesOperations - import_pipelines: ImportPipelinesOperations operations: Operations - pipeline_runs: PipelineRunsOperations private_endpoint_connections: PrivateEndpointConnectionsOperations registries: RegistriesOperations replications: ReplicationsOperations @@ -44,15 +39,10 @@ namespace azure.mgmt.containerregistry namespace azure.mgmt.containerregistry.aio class azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient: implements AsyncContextManager - archive_versions: ArchiveVersionsOperations - archives: ArchivesOperations cache_rules: CacheRulesOperations connected_registries: ConnectedRegistriesOperations credential_sets: CredentialSetsOperations - export_pipelines: ExportPipelinesOperations - import_pipelines: ImportPipelinesOperations operations: Operations - pipeline_runs: PipelineRunsOperations private_endpoint_connections: PrivateEndpointConnectionsOperations registries: RegistriesOperations replications: ReplicationsOperations @@ -85,181 +75,6 @@ namespace azure.mgmt.containerregistry.aio namespace azure.mgmt.containerregistry.aio.operations - class azure.mgmt.containerregistry.aio.operations.ArchiveVersionsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name', 'archive_version_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - **kwargs: Any - ) -> AsyncLROPoller[ArchiveVersion]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name', 'archive_version_name']}, api_versions_list=['2026-10-15-preview']) - async def begin_delete( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name', 'archive_version_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - async def get( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - **kwargs: Any - ) -> ArchiveVersion: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - def list( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - **kwargs: Any - ) -> AsyncItemPaged[ArchiveVersion]: ... - - - class azure.mgmt.containerregistry.aio.operations.ArchivesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: Archive, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Archive]: ... - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: Archive, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Archive]: ... - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Archive]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name']}, api_versions_list=['2026-10-15-preview']) - async def begin_delete( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - async def get( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - **kwargs: Any - ) -> Archive: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'accept']}, api_versions_list=['2026-10-15-preview']) - def list( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - **kwargs: Any - ) -> AsyncItemPaged[Archive]: ... - - @overload - async def update( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: ArchiveUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Archive: ... - - @overload - async def update( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: ArchiveUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Archive: ... - - @overload - async def update( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Archive: ... - - class azure.mgmt.containerregistry.aio.operations.CacheRulesOperations: def __init__( @@ -484,16 +299,6 @@ namespace azure.mgmt.containerregistry.aio.operations **kwargs: Any ) -> AsyncItemPaged[ConnectedRegistry]: ... - @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'connected_registry_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - async def resync( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - **kwargs: Any - ) -> ConnectedRegistry: ... - class azure.mgmt.containerregistry.aio.operations.CredentialSetsOperations: @@ -602,7 +407,19 @@ namespace azure.mgmt.containerregistry.aio.operations ) -> AsyncItemPaged[CredentialSet]: ... - class azure.mgmt.containerregistry.aio.operations.ExportPipelinesOperations: + class azure.mgmt.containerregistry.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[OperationDefinition]: ... + + + class azure.mgmt.containerregistry.aio.operations.PrivateEndpointConnectionsOperations: def __init__( self, @@ -611,72 +428,69 @@ namespace azure.mgmt.containerregistry.aio.operations ) -> None: ... @overload - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: ExportPipeline, + private_endpoint_connection_name: str, + private_endpoint_connection: PrivateEndpointConnection, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ExportPipeline]: ... + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... @overload - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: ExportPipeline, + private_endpoint_connection_name: str, + private_endpoint_connection: PrivateEndpointConnection, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ExportPipeline]: ... + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... @overload - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: IO[bytes], + private_endpoint_connection_name: str, + private_endpoint_connection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ExportPipeline]: ... + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'export_pipeline_name']}, api_versions_list=['2026-10-15-preview']) async def begin_delete( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, + private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'export_pipeline_name', 'accept']}, api_versions_list=['2026-10-15-preview']) async def get( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, + private_endpoint_connection_name: str, **kwargs: Any - ) -> ExportPipeline: ... + ) -> PrivateEndpointConnection: ... @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'accept']}, api_versions_list=['2026-10-15-preview']) def list( self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> AsyncItemPaged[ExportPipeline]: ... + ) -> AsyncItemPaged[PrivateEndpointConnection]: ... - class azure.mgmt.containerregistry.aio.operations.ImportPipelinesOperations: + class azure.mgmt.containerregistry.aio.operations.RegistriesOperations: def __init__( self, @@ -689,367 +503,136 @@ namespace azure.mgmt.containerregistry.aio.operations self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: ImportPipeline, + registry: Registry, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ImportPipeline]: ... + ) -> AsyncLROPoller[Registry]: ... @overload async def begin_create( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: ImportPipeline, + registry: Registry, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ImportPipeline]: ... + ) -> AsyncLROPoller[Registry]: ... @overload async def begin_create( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: IO[bytes], + registry: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ImportPipeline]: ... + ) -> AsyncLROPoller[Registry]: ... @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'import_pipeline_name']}, api_versions_list=['2026-10-15-preview']) async def begin_delete( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... - @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'import_pipeline_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - async def get( - self, - resource_group_name: str, - registry_name: str, - import_pipeline_name: str, - **kwargs: Any - ) -> ImportPipeline: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - def list( + @overload + async def begin_generate_credentials( self, resource_group_name: str, registry_name: str, + generate_credentials_parameters: GenerateCredentialsParameters, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[ImportPipeline]: ... - - - class azure.mgmt.containerregistry.aio.operations.Operations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged[OperationDefinition]: ... - - - class azure.mgmt.containerregistry.aio.operations.PipelineRunsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> AsyncLROPoller[GenerateCredentialsResult]: ... @overload - async def begin_create( + async def begin_generate_credentials( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: PipelineRun, + generate_credentials_parameters: GenerateCredentialsParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[PipelineRun]: ... + ) -> AsyncLROPoller[GenerateCredentialsResult]: ... @overload - async def begin_create( + async def begin_generate_credentials( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: PipelineRun, + generate_credentials_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[PipelineRun]: ... + ) -> AsyncLROPoller[GenerateCredentialsResult]: ... @overload - async def begin_create( + async def begin_import_image( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: IO[bytes], + parameters: ImportImageParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[PipelineRun]: ... + ) -> AsyncLROPoller[None]: ... - @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'pipeline_run_name']}, api_versions_list=['2026-10-15-preview']) - async def begin_delete( + @overload + async def begin_import_image( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, + parameters: ImportImageParameters, + *, + content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... - @distributed_trace_async - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'pipeline_run_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - async def get( + @overload + async def begin_import_image( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> PipelineRun: ... + ) -> AsyncLROPoller[None]: ... - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - def list( + @overload + async def begin_update( self, resource_group_name: str, registry_name: str, + registry_update_parameters: RegistryUpdateParameters, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[PipelineRun]: ... - - - class azure.mgmt.containerregistry.aio.operations.PrivateEndpointConnectionsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> AsyncLROPoller[Registry]: ... @overload - async def begin_create_or_update( + async def begin_update( self, resource_group_name: str, registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: PrivateEndpointConnection, + registry_update_parameters: RegistryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + ) -> AsyncLROPoller[Registry]: ... @overload - async def begin_create_or_update( + async def begin_update( self, resource_group_name: str, registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[PrivateEndpointConnection]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[PrivateEndpointConnection]: ... - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> PrivateEndpointConnection: ... - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> AsyncItemPaged[PrivateEndpointConnection]: ... - - - class azure.mgmt.containerregistry.aio.operations.RegistriesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - registry: Registry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Registry]: ... - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - registry: Registry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Registry]: ... - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - registry: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Registry]: ... - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @overload - async def begin_generate_credentials( - self, - resource_group_name: str, - registry_name: str, - generate_credentials_parameters: GenerateCredentialsParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[GenerateCredentialsResult]: ... - - @overload - async def begin_generate_credentials( - self, - resource_group_name: str, - registry_name: str, - generate_credentials_parameters: GenerateCredentialsParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[GenerateCredentialsResult]: ... - - @overload - async def begin_generate_credentials( - self, - resource_group_name: str, - registry_name: str, - generate_credentials_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[GenerateCredentialsResult]: ... - - @overload - async def begin_import_image( - self, - resource_group_name: str, - registry_name: str, - parameters: ImportImageParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @overload - async def begin_import_image( - self, - resource_group_name: str, - registry_name: str, - parameters: ImportImageParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @overload - async def begin_import_image( - self, - resource_group_name: str, - registry_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - registry_update_parameters: RegistryUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Registry]: ... - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - registry_update_parameters: RegistryUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Registry]: ... - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - registry_update_parameters: IO[bytes], + registry_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1656,44 +1239,53 @@ namespace azure.mgmt.containerregistry.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.AdditionalAuthenticationProperties(_Model): - authentication_type: str + class azure.mgmt.containerregistry.models.AuditLogStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.containerregistry.models.AuthCredential(_Model): + credential_health: Optional[CredentialHealth] + name: Optional[Union[str, CredentialName]] + password_secret_identifier: Optional[str] + username_secret_identifier: Optional[str] @overload def __init__( self, *, - authentication_type: str + name: Optional[Union[str, CredentialName]] = ..., + password_secret_identifier: Optional[str] = ..., + username_secret_identifier: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.AdditionalAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AWS_ELASTIC_CONTAINER_REGISTRY = "AwsElasticContainerRegistry" - ENTRA_FEDERATED_IDENTITY_CREDENTIAL = "EntraFederatedIdentityCredential" - GOOGLE_ARTIFACT_REGISTRY = "GoogleArtifactRegistry" - - - class azure.mgmt.containerregistry.models.AdditionalAuthenticationUpdateProperties(_Model): - authentication_type: str + class azure.mgmt.containerregistry.models.AzureADAuthenticationAsArmPolicy(_Model): + status: Optional[Union[str, AzureADAuthenticationAsArmPolicyStatus]] @overload def __init__( self, *, - authentication_type: str + status: Optional[Union[str, AzureADAuthenticationAsArmPolicyStatus]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.Archive(ProxyResource): + class azure.mgmt.containerregistry.models.AzureADAuthenticationAsArmPolicyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "disabled" + ENABLED = "enabled" + + + class azure.mgmt.containerregistry.models.CacheRule(ProxyResource): id: str name: str - properties: Optional[ArchiveProperties] + properties: Optional[CacheRuleProperties] system_data: SystemData type: str @@ -1703,7 +1295,7 @@ namespace azure.mgmt.containerregistry.models def __init__( self, *, - properties: Optional[ArchiveProperties] = ... + properties: Optional[CacheRuleProperties] = ... ) -> None: ... @overload @@ -1716,82 +1308,86 @@ namespace azure.mgmt.containerregistry.models ) -> None: ... - class azure.mgmt.containerregistry.models.ArchivePackageSourceProperties(_Model): - type: Optional[Union[str, PackageSourceType]] - url: Optional[str] + class azure.mgmt.containerregistry.models.CacheRuleProperties(_Model): + creation_date: Optional[datetime] + credential_set_resource_id: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + source_repository: Optional[str] + target_repository: Optional[str] @overload def __init__( self, *, - type: Optional[Union[str, PackageSourceType]] = ..., - url: Optional[str] = ... + credential_set_resource_id: Optional[str] = ..., + source_repository: Optional[str] = ..., + target_repository: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.ArchiveProperties(_Model): - package_source: Optional[ArchivePackageSourceProperties] - provisioning_state: Optional[Union[str, ProvisioningState]] - published_version: Optional[str] - repository_endpoint: Optional[str] - repository_endpoint_prefix: Optional[str] + class azure.mgmt.containerregistry.models.CacheRuleUpdateParameters(_Model): + properties: Optional[CacheRuleUpdateProperties] + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - package_source: Optional[ArchivePackageSourceProperties] = ..., - published_version: Optional[str] = ..., - repository_endpoint_prefix: Optional[str] = ... + properties: Optional[CacheRuleUpdateProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - class azure.mgmt.containerregistry.models.ArchiveUpdateParameters(_Model): - properties: Optional[ArchiveUpdateProperties] - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.containerregistry.models.CacheRuleUpdateProperties(_Model): + credential_set_resource_id: Optional[str] @overload def __init__( self, *, - properties: Optional[ArchiveUpdateProperties] = ... + credential_set_resource_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - class azure.mgmt.containerregistry.models.ArchiveUpdateProperties(_Model): - published_version: Optional[str] + class azure.mgmt.containerregistry.models.CallbackConfig(_Model): + custom_headers: Optional[dict[str, str]] + service_uri: str @overload def __init__( self, *, - published_version: Optional[str] = ... + custom_headers: Optional[dict[str, str]] = ..., + service_uri: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.ArchiveVersion(ProxyResource): + class azure.mgmt.containerregistry.models.CertificateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOCAL_DIRECTORY = "LocalDirectory" + + + class azure.mgmt.containerregistry.models.ConnectedRegistry(ProxyResource): id: str name: str - properties: Optional[ArchiveVersionProperties] + properties: Optional[ConnectedRegistryProperties] system_data: SystemData type: str @@ -1801,216 +1397,7 @@ namespace azure.mgmt.containerregistry.models def __init__( self, *, - properties: Optional[ArchiveVersionProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.containerregistry.models.ArchiveVersionProperties(_Model): - archive_version_error_message: Optional[str] - provisioning_state: Optional[Union[str, ProvisioningState]] - - @overload - def __init__( - self, - *, - archive_version_error_message: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.AuditLogStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.containerregistry.models.AuthCredential(_Model): - credential_health: Optional[CredentialHealth] - name: Optional[Union[str, CredentialName]] - password_secret_identifier: Optional[str] - username_secret_identifier: Optional[str] - - @overload - def __init__( - self, - *, - name: Optional[Union[str, CredentialName]] = ..., - password_secret_identifier: Optional[str] = ..., - username_secret_identifier: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.AuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED_IDENTITY = "ManagedIdentity" - SYNC_TOKEN = "SyncToken" - - - class azure.mgmt.containerregistry.models.AutoGeneratedDomainNameLabelScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): - NO_REUSE = "NoReuse" - RESOURCE_GROUP_REUSE = "ResourceGroupReuse" - SUBSCRIPTION_REUSE = "SubscriptionReuse" - TENANT_REUSE = "TenantReuse" - UNSECURE = "Unsecure" - - - class azure.mgmt.containerregistry.models.AzureADAuthenticationAsArmPolicy(_Model): - status: Optional[Union[str, AzureADAuthenticationAsArmPolicyStatus]] - - @overload - def __init__( - self, - *, - status: Optional[Union[str, AzureADAuthenticationAsArmPolicyStatus]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.AzureADAuthenticationAsArmPolicyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "disabled" - ENABLED = "enabled" - - - class azure.mgmt.containerregistry.models.CacheRule(ProxyResource): - id: str - identity: Optional[IdentityProperties] - name: str - properties: Optional[CacheRuleProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... - - @overload - def __init__( - self, - *, - identity: Optional[IdentityProperties] = ..., - properties: Optional[CacheRuleProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.containerregistry.models.CacheRuleProperties(_Model): - additional_authentication_properties: Optional[AdditionalAuthenticationProperties] - creation_date: Optional[datetime] - credential_set_resource_id: Optional[str] - provisioning_state: Optional[Union[str, ProvisioningState]] - source_repository: Optional[str] - target_repository: Optional[str] - - @overload - def __init__( - self, - *, - additional_authentication_properties: Optional[AdditionalAuthenticationProperties] = ..., - credential_set_resource_id: Optional[str] = ..., - source_repository: Optional[str] = ..., - target_repository: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.CacheRuleUpdateParameters(_Model): - identity: Optional[IdentityProperties] - properties: Optional[CacheRuleUpdateProperties] - - def __getattr__(self, name: str) -> Any: ... - - @overload - def __init__( - self, - *, - identity: Optional[IdentityProperties] = ..., - properties: Optional[CacheRuleUpdateProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.containerregistry.models.CacheRuleUpdateProperties(_Model): - additional_authentication_properties: Optional[AdditionalAuthenticationUpdateProperties] - credential_set_resource_id: Optional[str] - - @overload - def __init__( - self, - *, - additional_authentication_properties: Optional[AdditionalAuthenticationUpdateProperties] = ..., - credential_set_resource_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.CallbackConfig(_Model): - custom_headers: Optional[dict[str, str]] - service_uri: str - - @overload - def __init__( - self, - *, - custom_headers: Optional[dict[str, str]] = ..., - service_uri: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.CertificateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LOCAL_DIRECTORY = "LocalDirectory" - - - class azure.mgmt.containerregistry.models.ConnectedRegistry(ProxyResource): - id: str - identity: Optional[ManagedServiceIdentity] - name: str - properties: Optional[ConnectedRegistryProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... - - @overload - def __init__( - self, - *, - identity: Optional[ManagedServiceIdentity] = ..., - properties: Optional[ConnectedRegistryProperties] = ... + properties: Optional[ConnectedRegistryProperties] = ... ) -> None: ... @overload @@ -2042,7 +1429,6 @@ namespace azure.mgmt.containerregistry.models notifications_list: Optional[list[str]] parent: ParentProperties provisioning_state: Optional[Union[str, ProvisioningState]] - registry_sync_result: Optional[RegistrySyncResult] status_details: Optional[list[StatusDetailProperties]] version: Optional[str] @@ -2056,8 +1442,7 @@ namespace azure.mgmt.containerregistry.models login_server: Optional[LoginServerProperties] = ..., mode: Union[str, ConnectedRegistryMode], notifications_list: Optional[list[str]] = ..., - parent: ParentProperties, - registry_sync_result: Optional[RegistrySyncResult] = ... + parent: ParentProperties ) -> None: ... @overload @@ -2065,7 +1450,6 @@ namespace azure.mgmt.containerregistry.models class azure.mgmt.containerregistry.models.ConnectedRegistryUpdateParameters(_Model): - identity: Optional[ManagedServiceIdentity] properties: Optional[ConnectedRegistryUpdateProperties] def __getattr__(self, name: str) -> Any: ... @@ -2074,7 +1458,6 @@ namespace azure.mgmt.containerregistry.models def __init__( self, *, - identity: Optional[ManagedServiceIdentity] = ..., properties: Optional[ConnectedRegistryUpdateProperties] = ... ) -> None: ... @@ -2251,48 +1634,6 @@ namespace azure.mgmt.containerregistry.models DENY = "Deny" - class azure.mgmt.containerregistry.models.EcrAuthenticationProperties(AdditionalAuthenticationProperties, discriminator='AwsElasticContainerRegistry'): - account_number: str - authentication_type: Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY] - region: str - role_name: str - role_path: Optional[str] - - @overload - def __init__( - self, - *, - account_number: str, - region: str, - role_name: str, - role_path: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.EcrAuthenticationUpdateProperties(AdditionalAuthenticationUpdateProperties, discriminator='AwsElasticContainerRegistry'): - account_number: Optional[str] - authentication_type: Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY] - region: Optional[str] - role_name: Optional[str] - role_path: Optional[str] - - @overload - def __init__( - self, - *, - account_number: Optional[str] = ..., - region: Optional[str] = ..., - role_name: Optional[str] = ..., - role_path: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.containerregistry.models.EncryptionProperty(_Model): key_vault_properties: Optional[KeyVaultProperties] status: Optional[Union[str, EncryptionStatus]] @@ -2319,40 +1660,6 @@ namespace azure.mgmt.containerregistry.models I_PV4_AND_I_PV6 = "IPv4AndIPv6" - class azure.mgmt.containerregistry.models.EntraFederatedIdentityCredentialAuthenticationProperties(AdditionalAuthenticationProperties, discriminator='EntraFederatedIdentityCredential'): - authentication_type: Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL] - federated_application_client_id: str - source_tenant_id: str - - @overload - def __init__( - self, - *, - federated_application_client_id: str, - source_tenant_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.EntraFederatedIdentityCredentialAuthenticationUpdateProperties(AdditionalAuthenticationUpdateProperties, discriminator='EntraFederatedIdentityCredential'): - authentication_type: Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL] - federated_application_client_id: Optional[str] - source_tenant_id: Optional[str] - - @overload - def __init__( - self, - *, - federated_application_client_id: Optional[str] = ..., - source_tenant_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.containerregistry.models.ErrorAdditionalInfo(_Model): info: Optional[Any] type: Optional[str] @@ -2482,128 +1789,23 @@ namespace azure.mgmt.containerregistry.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.ExportPipeline(ProxyResource): - id: str - identity: Optional[IdentityProperties] - location: Optional[str] - name: str - properties: Optional[ExportPipelineProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.containerregistry.models.ExportPolicy(_Model): + status: Optional[Union[str, ExportPolicyStatus]] @overload def __init__( self, *, - identity: Optional[IdentityProperties] = ..., - location: Optional[str] = ..., - properties: Optional[ExportPipelineProperties] = ... + status: Optional[Union[str, ExportPolicyStatus]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - class azure.mgmt.containerregistry.models.ExportPipelineProperties(_Model): - options: Optional[list[Union[str, PipelineOptions]]] - provisioning_state: Optional[Union[str, ProvisioningState]] - target: ExportPipelineTargetProperties - - @overload - def __init__( - self, - *, - options: Optional[list[Union[str, PipelineOptions]]] = ..., - target: ExportPipelineTargetProperties - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.ExportPipelineTargetProperties(_Model): - key_vault_uri: Optional[str] - storage_access_mode: Optional[Union[str, StorageAccessMode]] - type: Optional[str] - uri: Optional[str] - - @overload - def __init__( - self, - *, - key_vault_uri: Optional[str] = ..., - storage_access_mode: Optional[Union[str, StorageAccessMode]] = ..., - type: Optional[str] = ..., - uri: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.ExportPolicy(_Model): - status: Optional[Union[str, ExportPolicyStatus]] - - @overload - def __init__( - self, - *, - status: Optional[Union[str, ExportPolicyStatus]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.ExportPolicyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "disabled" - ENABLED = "enabled" - - - class azure.mgmt.containerregistry.models.GarAuthenticationProperties(AdditionalAuthenticationProperties, discriminator='GoogleArtifactRegistry'): - authentication_type: Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY] - project_number: str - workload_identity_pool: str - workload_identity_provider: str - - @overload - def __init__( - self, - *, - project_number: str, - workload_identity_pool: str, - workload_identity_provider: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.GarAuthenticationUpdateProperties(AdditionalAuthenticationUpdateProperties, discriminator='GoogleArtifactRegistry'): - authentication_type: Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY] - project_number: Optional[str] - workload_identity_pool: Optional[str] - workload_identity_provider: Optional[str] - - @overload - def __init__( - self, - *, - project_number: Optional[str] = ..., - workload_identity_pool: Optional[str] = ..., - workload_identity_provider: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.containerregistry.models.ExportPolicyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "disabled" + ENABLED = "enabled" class azure.mgmt.containerregistry.models.GarbageCollectionProperties(_Model): @@ -2715,75 +1917,6 @@ namespace azure.mgmt.containerregistry.models NO_FORCE = "NoForce" - class azure.mgmt.containerregistry.models.ImportPipeline(ProxyResource): - id: str - identity: Optional[IdentityProperties] - location: Optional[str] - name: str - properties: Optional[ImportPipelineProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... - - @overload - def __init__( - self, - *, - identity: Optional[IdentityProperties] = ..., - location: Optional[str] = ..., - properties: Optional[ImportPipelineProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.containerregistry.models.ImportPipelineProperties(_Model): - options: Optional[list[Union[str, PipelineOptions]]] - provisioning_state: Optional[Union[str, ProvisioningState]] - source: ImportPipelineSourceProperties - trigger: Optional[PipelineTriggerProperties] - - @overload - def __init__( - self, - *, - options: Optional[list[Union[str, PipelineOptions]]] = ..., - source: ImportPipelineSourceProperties, - trigger: Optional[PipelineTriggerProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.ImportPipelineSourceProperties(_Model): - key_vault_uri: Optional[str] - storage_access_mode: Optional[Union[str, StorageAccessMode]] - type: Optional[Union[str, PipelineSourceType]] - uri: Optional[str] - - @overload - def __init__( - self, - *, - key_vault_uri: Optional[str] = ..., - storage_access_mode: Optional[Union[str, StorageAccessMode]] = ..., - type: Optional[Union[str, PipelineSourceType]] = ..., - uri: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.containerregistry.models.ImportSource(_Model): credentials: Optional[ImportSourceCredentials] registry_uri: Optional[str] @@ -2868,36 +2001,6 @@ namespace azure.mgmt.containerregistry.models tls: Optional[TlsProperties] - class azure.mgmt.containerregistry.models.ManagedServiceIdentity(_Model): - principal_id: Optional[str] - tenant_id: Optional[str] - type: Union[str, ManagedServiceIdentityType] - user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] - - @overload - def __init__( - self, - *, - type: Union[str, ManagedServiceIdentityType], - user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - USER_ASSIGNED = "UserAssigned" - - - class azure.mgmt.containerregistry.models.MetadataSearch(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - class azure.mgmt.containerregistry.models.NetworkRuleBypassOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_SERVICES = "AzureServices" NONE = "None" @@ -3043,10 +2146,6 @@ namespace azure.mgmt.containerregistry.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.PackageSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - REMOTE = "remote" - - class azure.mgmt.containerregistry.models.ParentProperties(_Model): id: Optional[str] sync_properties: SyncProperties @@ -3068,414 +2167,193 @@ namespace azure.mgmt.containerregistry.models PASSWORD2 = "password2" - class azure.mgmt.containerregistry.models.PipelineOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTINUE_ON_ERRORS = "ContinueOnErrors" - DELETE_SOURCE_BLOB_ON_SUCCESS = "DeleteSourceBlobOnSuccess" - OVERWRITE_BLOBS = "OverwriteBlobs" - OVERWRITE_TAGS = "OverwriteTags" - - - class azure.mgmt.containerregistry.models.PipelineRun(ProxyResource): - id: str - name: str - properties: Optional[PipelineRunProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... + class azure.mgmt.containerregistry.models.Policies(_Model): + azure_ad_authentication_as_arm_policy: Optional[AzureADAuthenticationAsArmPolicy] + export_policy: Optional[ExportPolicy] + quarantine_policy: Optional[QuarantinePolicy] + retention_policy: Optional[RetentionPolicy] + trust_policy: Optional[TrustPolicy] @overload def __init__( self, *, - properties: Optional[PipelineRunProperties] = ... + azure_ad_authentication_as_arm_policy: Optional[AzureADAuthenticationAsArmPolicy] = ..., + export_policy: Optional[ExportPolicy] = ..., + quarantine_policy: Optional[QuarantinePolicy] = ..., + retention_policy: Optional[RetentionPolicy] = ..., + trust_policy: Optional[TrustPolicy] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... + + class azure.mgmt.containerregistry.models.PolicyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "disabled" + ENABLED = "enabled" - class azure.mgmt.containerregistry.models.PipelineRunProperties(_Model): - force_update_tag: Optional[str] - provisioning_state: Optional[Union[str, ProvisioningState]] - request: Optional[PipelineRunRequest] - response: Optional[PipelineRunResponse] + class azure.mgmt.containerregistry.models.PrivateEndpoint(_Model): + id: Optional[str] @overload def __init__( self, *, - force_update_tag: Optional[str] = ..., - request: Optional[PipelineRunRequest] = ... + id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.PipelineRunRequest(_Model): - artifacts: Optional[list[str]] - catalog_digest: Optional[str] - pipeline_resource_id: Optional[str] - source: Optional[PipelineRunSourceProperties] - target: Optional[PipelineRunTargetProperties] + class azure.mgmt.containerregistry.models.PrivateEndpointConnection(ProxyResource): + id: str + name: str + properties: Optional[PrivateEndpointConnectionProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - artifacts: Optional[list[str]] = ..., - catalog_digest: Optional[str] = ..., - pipeline_resource_id: Optional[str] = ..., - source: Optional[PipelineRunSourceProperties] = ..., - target: Optional[PipelineRunTargetProperties] = ... + properties: Optional[PrivateEndpointConnectionProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.containerregistry.models.PipelineRunResponse(_Model): - catalog_digest: Optional[str] - finish_time: Optional[datetime] - imported_artifacts: Optional[list[str]] - pipeline_run_error_message: Optional[str] - progress: Optional[ProgressProperties] - source: Optional[ImportPipelineSourceProperties] - start_time: Optional[datetime] - status: Optional[str] - target: Optional[ExportPipelineTargetProperties] - trigger: Optional[PipelineTriggerDescriptor] - - @overload - def __init__( + def __setattr__( self, - *, - catalog_digest: Optional[str] = ..., - finish_time: Optional[datetime] = ..., - imported_artifacts: Optional[list[str]] = ..., - pipeline_run_error_message: Optional[str] = ..., - progress: Optional[ProgressProperties] = ..., - source: Optional[ImportPipelineSourceProperties] = ..., - start_time: Optional[datetime] = ..., - status: Optional[str] = ..., - target: Optional[ExportPipelineTargetProperties] = ..., - trigger: Optional[PipelineTriggerDescriptor] = ... + key: str, + value: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.containerregistry.models.PipelineRunSourceProperties(_Model): - name: Optional[str] - type: Optional[Union[str, PipelineRunSourceType]] + class azure.mgmt.containerregistry.models.PrivateEndpointConnectionProperties(_Model): + private_endpoint: Optional[PrivateEndpoint] + private_link_service_connection_state: Optional[PrivateLinkServiceConnectionState] + provisioning_state: Optional[Union[str, ProvisioningState]] @overload def __init__( self, *, - name: Optional[str] = ..., - type: Optional[Union[str, PipelineRunSourceType]] = ... + private_endpoint: Optional[PrivateEndpoint] = ..., + private_link_service_connection_state: Optional[PrivateLinkServiceConnectionState] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.PipelineRunSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_STORAGE_BLOB = "AzureStorageBlob" - + class azure.mgmt.containerregistry.models.PrivateLinkResource(Resource): + id: str + name: str + properties: Optional[PrivateLinkResourceProperties] + system_data: SystemData + type: str - class azure.mgmt.containerregistry.models.PipelineRunTargetProperties(_Model): - name: Optional[str] - type: Optional[Union[str, PipelineRunTargetType]] + def __getattr__(self, name: str) -> Any: ... @overload def __init__( self, *, - name: Optional[str] = ..., - type: Optional[Union[str, PipelineRunTargetType]] = ... + properties: Optional[PrivateLinkResourceProperties] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.containerregistry.models.PipelineRunTargetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_STORAGE_BLOB = "AzureStorageBlob" + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... - class azure.mgmt.containerregistry.models.PipelineSourceTriggerDescriptor(_Model): - timestamp: Optional[datetime] + class azure.mgmt.containerregistry.models.PrivateLinkResourceProperties(_Model): + group_id: Optional[str] + required_members: Optional[list[str]] + required_zone_names: Optional[list[str]] @overload def __init__( self, *, - timestamp: Optional[datetime] = ... + required_zone_names: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.PipelineSourceTriggerProperties(_Model): - status: Union[str, TriggerStatus] + class azure.mgmt.containerregistry.models.PrivateLinkServiceConnectionState(_Model): + actions_required: Optional[Union[str, ActionsRequired]] + description: Optional[str] + status: Optional[Union[str, ConnectionStatus]] @overload def __init__( self, *, - status: Union[str, TriggerStatus] + actions_required: Optional[Union[str, ActionsRequired]] = ..., + description: Optional[str] = ..., + status: Optional[Union[str, ConnectionStatus]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.PipelineSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_STORAGE_BLOB_CONTAINER = "AzureStorageBlobContainer" + class azure.mgmt.containerregistry.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.mgmt.containerregistry.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.containerregistry.models.PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" - class azure.mgmt.containerregistry.models.PipelineTriggerDescriptor(_Model): - source_trigger: Optional[PipelineSourceTriggerDescriptor] + class azure.mgmt.containerregistry.models.QuarantinePolicy(_Model): + status: Optional[Union[str, PolicyStatus]] @overload def __init__( self, *, - source_trigger: Optional[PipelineSourceTriggerDescriptor] = ... + status: Optional[Union[str, PolicyStatus]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.PipelineTriggerProperties(_Model): - source_trigger: Optional[PipelineSourceTriggerProperties] + class azure.mgmt.containerregistry.models.RegenerateCredentialParameters(_Model): + name: Union[str, PasswordName] @overload def __init__( self, *, - source_trigger: Optional[PipelineSourceTriggerProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.Policies(_Model): - azure_ad_authentication_as_arm_policy: Optional[AzureADAuthenticationAsArmPolicy] - export_policy: Optional[ExportPolicy] - quarantine_policy: Optional[QuarantinePolicy] - retention_policy: Optional[RetentionPolicy] - soft_delete_policy: Optional[SoftDeletePolicy] - trust_policy: Optional[TrustPolicy] - - @overload - def __init__( - self, - *, - azure_ad_authentication_as_arm_policy: Optional[AzureADAuthenticationAsArmPolicy] = ..., - export_policy: Optional[ExportPolicy] = ..., - quarantine_policy: Optional[QuarantinePolicy] = ..., - retention_policy: Optional[RetentionPolicy] = ..., - soft_delete_policy: Optional[SoftDeletePolicy] = ..., - trust_policy: Optional[TrustPolicy] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.PolicyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "disabled" - ENABLED = "enabled" - - - class azure.mgmt.containerregistry.models.PrivateEndpoint(_Model): - id: Optional[str] - - @overload - def __init__( - self, - *, - id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.PrivateEndpointConnection(ProxyResource): - id: str - name: str - properties: Optional[PrivateEndpointConnectionProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... - - @overload - def __init__( - self, - *, - properties: Optional[PrivateEndpointConnectionProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.containerregistry.models.PrivateEndpointConnectionProperties(_Model): - private_endpoint: Optional[PrivateEndpoint] - private_link_service_connection_state: Optional[PrivateLinkServiceConnectionState] - provisioning_state: Optional[Union[str, ProvisioningState]] - - @overload - def __init__( - self, - *, - private_endpoint: Optional[PrivateEndpoint] = ..., - private_link_service_connection_state: Optional[PrivateLinkServiceConnectionState] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.PrivateLinkResource(Resource): - id: str - name: str - properties: Optional[PrivateLinkResourceProperties] - system_data: SystemData - type: str - - def __getattr__(self, name: str) -> Any: ... - - @overload - def __init__( - self, - *, - properties: Optional[PrivateLinkResourceProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - def __setattr__( - self, - key: str, - value: Any - ) -> None: ... - - - class azure.mgmt.containerregistry.models.PrivateLinkResourceProperties(_Model): - group_id: Optional[str] - required_members: Optional[list[str]] - required_zone_names: Optional[list[str]] - - @overload - def __init__( - self, - *, - required_zone_names: Optional[list[str]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.PrivateLinkServiceConnectionState(_Model): - actions_required: Optional[Union[str, ActionsRequired]] - description: Optional[str] - status: Optional[Union[str, ConnectionStatus]] - - @overload - def __init__( - self, - *, - actions_required: Optional[Union[str, ActionsRequired]] = ..., - description: Optional[str] = ..., - status: Optional[Union[str, ConnectionStatus]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.ProgressProperties(_Model): - percentage: Optional[str] - - @overload - def __init__( - self, - *, - percentage: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELED = "Canceled" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - UPDATING = "Updating" - - - class azure.mgmt.containerregistry.models.ProxyResource(Resource): - id: str - name: str - system_data: SystemData - type: str - - - class azure.mgmt.containerregistry.models.PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.containerregistry.models.QuarantinePolicy(_Model): - status: Optional[Union[str, PolicyStatus]] - - @overload - def __init__( - self, - *, - status: Optional[Union[str, PolicyStatus]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.RegenerateCredentialParameters(_Model): - name: Union[str, PasswordName] - - @overload - def __init__( - self, - *, - name: Union[str, PasswordName] + name: Union[str, PasswordName] ) -> None: ... @overload @@ -3538,18 +2416,14 @@ namespace azure.mgmt.containerregistry.models class azure.mgmt.containerregistry.models.RegistryNameCheckRequest(_Model): - auto_generated_domain_name_label_scope: Optional[Union[str, AutoGeneratedDomainNameLabelScope]] name: str - resource_group_name: Optional[str] type: Union[str, ContainerRegistryResourceType] @overload def __init__( self, *, - auto_generated_domain_name_label_scope: Optional[Union[str, AutoGeneratedDomainNameLabelScope]] = ..., name: str, - resource_group_name: Optional[str] = ..., type: Union[str, ContainerRegistryResourceType] ) -> None: ... @@ -3558,7 +2432,6 @@ namespace azure.mgmt.containerregistry.models class azure.mgmt.containerregistry.models.RegistryNameStatus(_Model): - available_login_server_name: Optional[str] message: Optional[str] name_available: Optional[bool] reason: Optional[str] @@ -3567,7 +2440,6 @@ namespace azure.mgmt.containerregistry.models def __init__( self, *, - available_login_server_name: Optional[str] = ..., message: Optional[str] = ..., name_available: Optional[bool] = ..., reason: Optional[str] = ... @@ -3596,14 +2468,12 @@ namespace azure.mgmt.containerregistry.models class azure.mgmt.containerregistry.models.RegistryProperties(_Model): admin_user_enabled: Optional[bool] anonymous_pull_enabled: Optional[bool] - auto_generated_domain_name_label_scope: Optional[Union[str, AutoGeneratedDomainNameLabelScope]] creation_date: Optional[datetime] data_endpoint_enabled: Optional[bool] data_endpoint_host_names: Optional[list[str]] encryption: Optional[EncryptionProperty] endpoint_protocol: Optional[Union[str, EndpointProtocol]] login_server: Optional[str] - metadata_search: Optional[Union[str, MetadataSearch]] network_rule_bypass_allowed_for_tasks: Optional[bool] network_rule_bypass_options: Optional[Union[str, NetworkRuleBypassOptions]] network_rule_set: Optional[NetworkRuleSet] @@ -3615,7 +2485,6 @@ namespace azure.mgmt.containerregistry.models regional_endpoints: Optional[Union[str, RegionalEndpoints]] role_assignment_mode: Optional[Union[str, RoleAssignmentMode]] status: Optional[Status] - writable_cache_repos: Optional[Union[str, WritableCacheRepos]] zone_redundancy: Optional[Union[str, ZoneRedundancy]] @overload @@ -3624,11 +2493,9 @@ namespace azure.mgmt.containerregistry.models *, admin_user_enabled: Optional[bool] = ..., anonymous_pull_enabled: Optional[bool] = ..., - auto_generated_domain_name_label_scope: Optional[Union[str, AutoGeneratedDomainNameLabelScope]] = ..., data_endpoint_enabled: Optional[bool] = ..., encryption: Optional[EncryptionProperty] = ..., endpoint_protocol: Optional[Union[str, EndpointProtocol]] = ..., - metadata_search: Optional[Union[str, MetadataSearch]] = ..., network_rule_bypass_allowed_for_tasks: Optional[bool] = ..., network_rule_bypass_options: Optional[Union[str, NetworkRuleBypassOptions]] = ..., network_rule_set: Optional[NetworkRuleSet] = ..., @@ -3636,7 +2503,6 @@ namespace azure.mgmt.containerregistry.models public_network_access: Optional[Union[str, PublicNetworkAccess]] = ..., regional_endpoints: Optional[Union[str, RegionalEndpoints]] = ..., role_assignment_mode: Optional[Union[str, RoleAssignmentMode]] = ..., - writable_cache_repos: Optional[Union[str, WritableCacheRepos]] = ..., zone_redundancy: Optional[Union[str, ZoneRedundancy]] = ... ) -> None: ... @@ -3650,7 +2516,6 @@ namespace azure.mgmt.containerregistry.models data_endpoint_enabled: Optional[bool] encryption: Optional[EncryptionProperty] endpoint_protocol: Optional[Union[str, EndpointProtocol]] - metadata_search: Optional[Union[str, MetadataSearch]] network_rule_bypass_allowed_for_tasks: Optional[bool] network_rule_bypass_options: Optional[Union[str, NetworkRuleBypassOptions]] network_rule_set: Optional[NetworkRuleSet] @@ -3658,7 +2523,6 @@ namespace azure.mgmt.containerregistry.models public_network_access: Optional[Union[str, PublicNetworkAccess]] regional_endpoints: Optional[Union[str, RegionalEndpoints]] role_assignment_mode: Optional[Union[str, RoleAssignmentMode]] - writable_cache_repos: Optional[Union[str, WritableCacheRepos]] @overload def __init__( @@ -3669,35 +2533,13 @@ namespace azure.mgmt.containerregistry.models data_endpoint_enabled: Optional[bool] = ..., encryption: Optional[EncryptionProperty] = ..., endpoint_protocol: Optional[Union[str, EndpointProtocol]] = ..., - metadata_search: Optional[Union[str, MetadataSearch]] = ..., network_rule_bypass_allowed_for_tasks: Optional[bool] = ..., network_rule_bypass_options: Optional[Union[str, NetworkRuleBypassOptions]] = ..., network_rule_set: Optional[NetworkRuleSet] = ..., policies: Optional[Policies] = ..., public_network_access: Optional[Union[str, PublicNetworkAccess]] = ..., regional_endpoints: Optional[Union[str, RegionalEndpoints]] = ..., - role_assignment_mode: Optional[Union[str, RoleAssignmentMode]] = ..., - writable_cache_repos: Optional[Union[str, WritableCacheRepos]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.containerregistry.models.RegistrySyncResult(_Model): - last_successful_sync_end_time: Optional[datetime] - last_sync_end_time: Optional[datetime] - last_sync_start_time: Optional[datetime] - sync_state: Union[str, SyncState] - sync_trigger: Union[str, SyncTrigger] - - @overload - def __init__( - self, - *, - last_successful_sync_end_time: Optional[datetime] = ..., - last_sync_end_time: Optional[datetime] = ..., - last_sync_start_time: Optional[datetime] = ... + role_assignment_mode: Optional[Union[str, RoleAssignmentMode]] = ... ) -> None: ... @overload @@ -4027,23 +2869,6 @@ namespace azure.mgmt.containerregistry.models STANDARD = "Standard" - class azure.mgmt.containerregistry.models.SoftDeletePolicy(_Model): - last_updated_time: Optional[datetime] - retention_days: Optional[int] - status: Optional[Union[str, PolicyStatus]] - - @overload - def __init__( - self, - *, - retention_days: Optional[int] = ..., - status: Optional[Union[str, PolicyStatus]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.containerregistry.models.Source(_Model): addr: Optional[str] instance_id: Optional[str] @@ -4067,22 +2892,14 @@ namespace azure.mgmt.containerregistry.models class azure.mgmt.containerregistry.models.StatusDetailProperties(_Model): - available_gib: Optional[float] code: Optional[str] correlation_id: Optional[str] description: Optional[str] timestamp: Optional[datetime] - total_gib: Optional[float] type: Optional[str] - class azure.mgmt.containerregistry.models.StorageAccessMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED_IDENTITY = "ManagedIdentity" - SAS_TOKEN = "SasToken" - - class azure.mgmt.containerregistry.models.SyncProperties(_Model): - auth_type: Optional[Union[str, AuthType]] gateway_endpoint: Optional[str] last_sync_time: Optional[datetime] message_ttl: timedelta @@ -4094,7 +2911,6 @@ namespace azure.mgmt.containerregistry.models def __init__( self, *, - auth_type: Optional[Union[str, AuthType]] = ..., message_ttl: timedelta, schedule: Optional[str] = ..., sync_window: Optional[timedelta] = ..., @@ -4105,24 +2921,7 @@ namespace azure.mgmt.containerregistry.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.SyncState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FAILED = "Failed" - NOT_ACTIVATED = "NotActivated" - PENDING = "Pending" - SUCCEEDED = "Succeeded" - SYNCING = "Syncing" - TIMED_OUT = "TimedOut" - - - class azure.mgmt.containerregistry.models.SyncTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INITIAL_SYNC = "InitialSync" - MANUAL_RESYNC = "ManualResync" - RECOVERY_SERVICE = "RecoveryService" - SYNC_TOKEN_UPDATE = "SyncTokenUpdate" - - class azure.mgmt.containerregistry.models.SyncUpdateProperties(_Model): - auth_type: Optional[Union[str, AuthType]] message_ttl: Optional[timedelta] schedule: Optional[str] sync_window: Optional[timedelta] @@ -4131,7 +2930,6 @@ namespace azure.mgmt.containerregistry.models def __init__( self, *, - auth_type: Optional[Union[str, AuthType]] = ..., message_ttl: Optional[timedelta] = ..., schedule: Optional[str] = ..., sync_window: Optional[timedelta] = ... @@ -4386,11 +3184,6 @@ namespace azure.mgmt.containerregistry.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.containerregistry.models.TriggerStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - class azure.mgmt.containerregistry.models.TrustPolicy(_Model): status: Optional[Union[str, PolicyStatus]] type: Optional[Union[str, TrustPolicyType]] @@ -4411,11 +3204,6 @@ namespace azure.mgmt.containerregistry.models NOTARY = "Notary" - class azure.mgmt.containerregistry.models.UserAssignedIdentity(_Model): - client_id: Optional[str] - principal_id: Optional[str] - - class azure.mgmt.containerregistry.models.UserIdentityProperties(_Model): client_id: Optional[str] principal_id: Optional[str] @@ -4593,11 +3381,6 @@ namespace azure.mgmt.containerregistry.models ) -> None: ... - class azure.mgmt.containerregistry.models.WritableCacheRepos(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - class azure.mgmt.containerregistry.models.ZoneRedundancy(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" ENABLED = "Enabled" @@ -4605,7 +3388,7 @@ namespace azure.mgmt.containerregistry.models namespace azure.mgmt.containerregistry.operations - class azure.mgmt.containerregistry.operations.ArchiveVersionsOperations: + class azure.mgmt.containerregistry.operations.CacheRulesOperations: def __init__( self, @@ -4613,182 +3396,7 @@ namespace azure.mgmt.containerregistry.operations **kwargs ) -> None: ... - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name', 'archive_version_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - **kwargs: Any - ) -> LROPoller[ArchiveVersion]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name', 'archive_version_name']}, api_versions_list=['2026-10-15-preview']) - def begin_delete( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name', 'archive_version_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - def get( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - **kwargs: Any - ) -> ArchiveVersion: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - def list( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - **kwargs: Any - ) -> ItemPaged[ArchiveVersion]: ... - - - class azure.mgmt.containerregistry.operations.ArchivesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: Archive, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Archive]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: Archive, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Archive]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Archive]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name']}, api_versions_list=['2026-10-15-preview']) - def begin_delete( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'archive_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - def get( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - **kwargs: Any - ) -> Archive: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'package_type', 'accept']}, api_versions_list=['2026-10-15-preview']) - def list( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - **kwargs: Any - ) -> ItemPaged[Archive]: ... - - @overload - def update( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: ArchiveUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Archive: ... - - @overload - def update( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: ArchiveUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Archive: ... - - @overload - def update( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Archive: ... - - - class azure.mgmt.containerregistry.operations.CacheRulesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload + @overload def begin_create( self, resource_group_name: str, @@ -4938,265 +3546,74 @@ namespace azure.mgmt.containerregistry.operations registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: ConnectedRegistryUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ConnectedRegistry]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: ConnectedRegistryUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ConnectedRegistry]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ConnectedRegistry]: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - **kwargs: Any - ) -> ConnectedRegistry: ... - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - *, - filter: Optional[str] = ..., - **kwargs: Any - ) -> ItemPaged[ConnectedRegistry]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'connected_registry_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - def resync( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - **kwargs: Any - ) -> ConnectedRegistry: ... - - - class azure.mgmt.containerregistry.operations.CredentialSetsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_create_parameters: CredentialSet, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CredentialSet]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_create_parameters: CredentialSet, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CredentialSet]: ... - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CredentialSet]: ... - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_update_parameters: CredentialSetUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CredentialSet]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_update_parameters: CredentialSetUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CredentialSet]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_update_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[CredentialSet]: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - **kwargs: Any - ) -> CredentialSet: ... + ) -> LROPoller[None]: ... @distributed_trace - def list( + def begin_delete( self, resource_group_name: str, registry_name: str, + connected_registry_name: str, **kwargs: Any - ) -> ItemPaged[CredentialSet]: ... - - - class azure.mgmt.containerregistry.operations.ExportPipelinesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> LROPoller[None]: ... @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: ExportPipeline, + connected_registry_name: str, + connected_registry_update_parameters: ConnectedRegistryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ExportPipeline]: ... + ) -> LROPoller[ConnectedRegistry]: ... @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: ExportPipeline, + connected_registry_name: str, + connected_registry_update_parameters: ConnectedRegistryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ExportPipeline]: ... + ) -> LROPoller[ConnectedRegistry]: ... @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: IO[bytes], + connected_registry_name: str, + connected_registry_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ExportPipeline]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'export_pipeline_name']}, api_versions_list=['2026-10-15-preview']) - def begin_delete( - self, - resource_group_name: str, - registry_name: str, - export_pipeline_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... + ) -> LROPoller[ConnectedRegistry]: ... @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'export_pipeline_name', 'accept']}, api_versions_list=['2026-10-15-preview']) def get( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, + connected_registry_name: str, **kwargs: Any - ) -> ExportPipeline: ... + ) -> ConnectedRegistry: ... @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'accept']}, api_versions_list=['2026-10-15-preview']) def list( self, resource_group_name: str, registry_name: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> ItemPaged[ExportPipeline]: ... + ) -> ItemPaged[ConnectedRegistry]: ... - class azure.mgmt.containerregistry.operations.ImportPipelinesOperations: + class azure.mgmt.containerregistry.operations.CredentialSetsOperations: def __init__( self, @@ -5209,151 +3626,110 @@ namespace azure.mgmt.containerregistry.operations self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: ImportPipeline, + credential_set_name: str, + credential_set_create_parameters: CredentialSet, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ImportPipeline]: ... + ) -> LROPoller[CredentialSet]: ... @overload def begin_create( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: ImportPipeline, + credential_set_name: str, + credential_set_create_parameters: CredentialSet, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ImportPipeline]: ... + ) -> LROPoller[CredentialSet]: ... @overload def begin_create( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: IO[bytes], + credential_set_name: str, + credential_set_create_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[ImportPipeline]: ... + ) -> LROPoller[CredentialSet]: ... @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'import_pipeline_name']}, api_versions_list=['2026-10-15-preview']) def begin_delete( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, + credential_set_name: str, **kwargs: Any ) -> LROPoller[None]: ... - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'import_pipeline_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - def get( - self, - resource_group_name: str, - registry_name: str, - import_pipeline_name: str, - **kwargs: Any - ) -> ImportPipeline: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'accept']}, api_versions_list=['2026-10-15-preview']) - def list( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> ItemPaged[ImportPipeline]: ... - - - class azure.mgmt.containerregistry.operations.Operations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[OperationDefinition]: ... - - - class azure.mgmt.containerregistry.operations.PipelineRunsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: PipelineRun, + credential_set_name: str, + credential_set_update_parameters: CredentialSetUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[PipelineRun]: ... + ) -> LROPoller[CredentialSet]: ... @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: PipelineRun, + credential_set_name: str, + credential_set_update_parameters: CredentialSetUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[PipelineRun]: ... + ) -> LROPoller[CredentialSet]: ... @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: IO[bytes], + credential_set_name: str, + credential_set_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[PipelineRun]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'pipeline_run_name']}, api_versions_list=['2026-10-15-preview']) - def begin_delete( - self, - resource_group_name: str, - registry_name: str, - pipeline_run_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... + ) -> LROPoller[CredentialSet]: ... @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'pipeline_run_name', 'accept']}, api_versions_list=['2026-10-15-preview']) def get( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, + credential_set_name: str, **kwargs: Any - ) -> PipelineRun: ... + ) -> CredentialSet: ... @distributed_trace - @api_version_validation(method_added_on='2026-10-15-preview', params_added_on={'2026-10-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'registry_name', 'accept']}, api_versions_list=['2026-10-15-preview']) def list( self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> ItemPaged[PipelineRun]: ... + ) -> ItemPaged[CredentialSet]: ... + + + class azure.mgmt.containerregistry.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[OperationDefinition]: ... class azure.mgmt.containerregistry.operations.PrivateEndpointConnectionsOperations: @@ -6149,55 +4525,6 @@ namespace azure.mgmt.containerregistry.types status: Union[str, ActivationStatus] - class azure.mgmt.containerregistry.types.AdditionalAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AWS_ELASTIC_CONTAINER_REGISTRY = "AwsElasticContainerRegistry" - ENTRA_FEDERATED_IDENTITY_CREDENTIAL = "EntraFederatedIdentityCredential" - GOOGLE_ARTIFACT_REGISTRY = "GoogleArtifactRegistry" - - - class azure.mgmt.containerregistry.types.Archive(ProxyResource): - key "id": str - key "name": str - key "properties": ForwardRef('ArchiveProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - id: str - name: str - properties: ArchiveProperties - systemData: SystemData - type: str - - - class azure.mgmt.containerregistry.types.ArchivePackageSourceProperties(TypedDict, total=False): - key "type": Union[str, PackageSourceType] - key "url": str - type: Union[str, PackageSourceType] - url: str - - - class azure.mgmt.containerregistry.types.ArchiveProperties(TypedDict, total=False): - key "packageSource": ForwardRef('ArchivePackageSourceProperties', module='types') - key "provisioningState": Union[str, ProvisioningState] - key "publishedVersion": str - key "repositoryEndpoint": str - key "repositoryEndpointPrefix": str - packageSource: ArchivePackageSourceProperties - provisioningState: Union[str, ProvisioningState] - publishedVersion: str - repositoryEndpoint: str - repositoryEndpointPrefix: str - - - class azure.mgmt.containerregistry.types.ArchiveUpdateParameters(TypedDict, total=False): - key "properties": ForwardRef('ArchiveUpdateProperties', module='types') - properties: ArchiveUpdateProperties - - - class azure.mgmt.containerregistry.types.ArchiveUpdateProperties(TypedDict, total=False): - key "publishedVersion": str - publishedVersion: str - - class azure.mgmt.containerregistry.types.AuthCredential(TypedDict, total=False): key "credentialHealth": ForwardRef('CredentialHealth', module='types') key "name": Union[str, CredentialName] @@ -6216,13 +4543,11 @@ namespace azure.mgmt.containerregistry.types class azure.mgmt.containerregistry.types.CacheRule(ProxyResource): key "id": str - key "identity": ForwardRef('IdentityProperties', module='types') key "name": str key "properties": ForwardRef('CacheRuleProperties', module='types') key "systemData": ForwardRef('SystemData', module='types') key "type": str id: str - identity: IdentityProperties name: str properties: CacheRuleProperties systemData: SystemData @@ -6230,13 +4555,11 @@ namespace azure.mgmt.containerregistry.types class azure.mgmt.containerregistry.types.CacheRuleProperties(TypedDict, total=False): - key "additionalAuthenticationProperties": ForwardRef('AdditionalAuthenticationProperties', module='types') key "creationDate": str key "credentialSetResourceId": str key "provisioningState": Union[str, ProvisioningState] key "sourceRepository": str key "targetRepository": str - additionalAuthenticationProperties: AdditionalAuthenticationProperties creationDate: str credentialSetResourceId: str provisioningState: Union[str, ProvisioningState] @@ -6245,28 +4568,22 @@ namespace azure.mgmt.containerregistry.types class azure.mgmt.containerregistry.types.CacheRuleUpdateParameters(TypedDict, total=False): - key "identity": ForwardRef('IdentityProperties', module='types') key "properties": ForwardRef('CacheRuleUpdateProperties', module='types') - identity: IdentityProperties properties: CacheRuleUpdateProperties class azure.mgmt.containerregistry.types.CacheRuleUpdateProperties(TypedDict, total=False): - key "additionalAuthenticationProperties": ForwardRef('AdditionalAuthenticationUpdateProperties', module='types') key "credentialSetResourceId": str - additionalAuthenticationProperties: AdditionalAuthenticationUpdateProperties credentialSetResourceId: str class azure.mgmt.containerregistry.types.ConnectedRegistry(ProxyResource): key "id": str - key "identity": ForwardRef('ManagedServiceIdentity', module='types') key "name": str key "properties": ForwardRef('ConnectedRegistryProperties', module='types') key "systemData": ForwardRef('SystemData', module='types') key "type": str id: str - identity: ManagedServiceIdentity name: str properties: ConnectedRegistryProperties systemData: SystemData @@ -6283,7 +4600,6 @@ namespace azure.mgmt.containerregistry.types key "mode": Required[Union[str, ConnectedRegistryMode]] key "parent": Required[ParentProperties] key "provisioningState": Union[str, ProvisioningState] - key "registrySyncResult": ForwardRef('RegistrySyncResult', module='types') key "version": str activation: ActivationProperties clientTokenIds: list[str] @@ -6296,15 +4612,12 @@ namespace azure.mgmt.containerregistry.types notificationsList: list[str] parent: ParentProperties provisioningState: Union[str, ProvisioningState] - registrySyncResult: RegistrySyncResult statusDetails: list[StatusDetailProperties] version: str class azure.mgmt.containerregistry.types.ConnectedRegistryUpdateParameters(TypedDict, total=False): - key "identity": ForwardRef('ManagedServiceIdentity', module='types') key "properties": ForwardRef('ConnectedRegistryUpdateProperties', module='types') - identity: ManagedServiceIdentity properties: ConnectedRegistryUpdateProperties @@ -6364,32 +4677,6 @@ namespace azure.mgmt.containerregistry.types authCredentials: list[AuthCredential] - class azure.mgmt.containerregistry.types.EcrAuthenticationProperties(TypedDict, total=False): - key "accountNumber": Required[str] - key "authenticationType": Required[Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY]] - key "region": Required[str] - key "roleName": Required[str] - key "rolePath": str - accountNumber: str - authenticationType: Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY] - region: str - roleName: str - rolePath: str - - - class azure.mgmt.containerregistry.types.EcrAuthenticationUpdateProperties(TypedDict, total=False): - key "accountNumber": str - key "authenticationType": Required[Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY]] - key "region": str - key "roleName": str - key "rolePath": str - accountNumber: str - authenticationType: Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY] - region: str - roleName: str - rolePath: str - - class azure.mgmt.containerregistry.types.EncryptionProperty(TypedDict, total=False): key "keyVaultProperties": ForwardRef('KeyVaultProperties', module='types') key "status": Union[str, EncryptionStatus] @@ -6397,87 +4684,11 @@ namespace azure.mgmt.containerregistry.types status: Union[str, EncryptionStatus] - class azure.mgmt.containerregistry.types.EntraFederatedIdentityCredentialAuthenticationProperties(TypedDict, total=False): - key "authenticationType": Required[Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL]] - key "federatedApplicationClientId": Required[str] - key "sourceTenantId": Required[str] - authenticationType: Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL] - federatedApplicationClientId: str - sourceTenantId: str - - - class azure.mgmt.containerregistry.types.EntraFederatedIdentityCredentialAuthenticationUpdateProperties(TypedDict, total=False): - key "authenticationType": Required[Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL]] - key "federatedApplicationClientId": str - key "sourceTenantId": str - authenticationType: Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL] - federatedApplicationClientId: str - sourceTenantId: str - - - class azure.mgmt.containerregistry.types.ExportPipeline(ProxyResource): - key "id": str - key "identity": ForwardRef('IdentityProperties', module='types') - key "location": str - key "name": str - key "properties": ForwardRef('ExportPipelineProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - id: str - identity: IdentityProperties - location: str - name: str - properties: ExportPipelineProperties - systemData: SystemData - type: str - - - class azure.mgmt.containerregistry.types.ExportPipelineProperties(TypedDict, total=False): - key "provisioningState": Union[str, ProvisioningState] - key "target": Required[ExportPipelineTargetProperties] - options: list[Union[str, PipelineOptions]] - provisioningState: Union[str, ProvisioningState] - target: ExportPipelineTargetProperties - - - class azure.mgmt.containerregistry.types.ExportPipelineTargetProperties(TypedDict, total=False): - key "keyVaultUri": str - key "storageAccessMode": Union[str, StorageAccessMode] - key "type": str - key "uri": str - keyVaultUri: str - storageAccessMode: Union[str, StorageAccessMode] - type: str - uri: str - - class azure.mgmt.containerregistry.types.ExportPolicy(TypedDict, total=False): key "status": Union[str, ExportPolicyStatus] status: Union[str, ExportPolicyStatus] - class azure.mgmt.containerregistry.types.GarAuthenticationProperties(TypedDict, total=False): - key "authenticationType": Required[Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY]] - key "projectNumber": Required[str] - key "workloadIdentityPool": Required[str] - key "workloadIdentityProvider": Required[str] - authenticationType: Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY] - projectNumber: str - workloadIdentityPool: str - workloadIdentityProvider: str - - - class azure.mgmt.containerregistry.types.GarAuthenticationUpdateProperties(TypedDict, total=False): - key "authenticationType": Required[Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY]] - key "projectNumber": str - key "workloadIdentityPool": str - key "workloadIdentityProvider": str - authenticationType: Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY] - projectNumber: str - workloadIdentityPool: str - workloadIdentityProvider: str - - class azure.mgmt.containerregistry.types.GarbageCollectionProperties(TypedDict, total=False): key "enabled": bool key "schedule": str @@ -6520,44 +4731,6 @@ namespace azure.mgmt.containerregistry.types untaggedTargetRepositories: list[str] - class azure.mgmt.containerregistry.types.ImportPipeline(ProxyResource): - key "id": str - key "identity": ForwardRef('IdentityProperties', module='types') - key "location": str - key "name": str - key "properties": ForwardRef('ImportPipelineProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - id: str - identity: IdentityProperties - location: str - name: str - properties: ImportPipelineProperties - systemData: SystemData - type: str - - - class azure.mgmt.containerregistry.types.ImportPipelineProperties(TypedDict, total=False): - key "provisioningState": Union[str, ProvisioningState] - key "source": Required[ImportPipelineSourceProperties] - key "trigger": ForwardRef('PipelineTriggerProperties', module='types') - options: list[Union[str, PipelineOptions]] - provisioningState: Union[str, ProvisioningState] - source: ImportPipelineSourceProperties - trigger: PipelineTriggerProperties - - - class azure.mgmt.containerregistry.types.ImportPipelineSourceProperties(TypedDict, total=False): - key "keyVaultUri": str - key "storageAccessMode": Union[str, StorageAccessMode] - key "type": Union[str, PipelineSourceType] - key "uri": str - keyVaultUri: str - storageAccessMode: Union[str, StorageAccessMode] - type: Union[str, PipelineSourceType] - uri: str - - class azure.mgmt.containerregistry.types.ImportSource(TypedDict, total=False): key "credentials": ForwardRef('ImportSourceCredentials', module='types') key "registryUri": str @@ -6603,16 +4776,6 @@ namespace azure.mgmt.containerregistry.types tls: TlsProperties - class azure.mgmt.containerregistry.types.ManagedServiceIdentity(TypedDict, total=False): - key "principalId": str - key "tenantId": str - key "type": Required[Union[str, ManagedServiceIdentityType]] - principalId: str - tenantId: str - type: Union[str, ManagedServiceIdentityType] - userAssignedIdentities: dict[str, UserAssignedIdentity] - - class azure.mgmt.containerregistry.types.NetworkRuleSet(TypedDict, total=False): key "defaultAction": Required[Union[str, DefaultAction]] defaultAction: Union[str, DefaultAction] @@ -6627,110 +4790,16 @@ namespace azure.mgmt.containerregistry.types syncProperties: SyncProperties - class azure.mgmt.containerregistry.types.PipelineRun(ProxyResource): - key "id": str - key "name": str - key "properties": ForwardRef('PipelineRunProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - id: str - name: str - properties: PipelineRunProperties - systemData: SystemData - type: str - - - class azure.mgmt.containerregistry.types.PipelineRunProperties(TypedDict, total=False): - key "forceUpdateTag": str - key "provisioningState": Union[str, ProvisioningState] - key "request": ForwardRef('PipelineRunRequest', module='types') - key "response": ForwardRef('PipelineRunResponse', module='types') - forceUpdateTag: str - provisioningState: Union[str, ProvisioningState] - request: PipelineRunRequest - response: PipelineRunResponse - - - class azure.mgmt.containerregistry.types.PipelineRunRequest(TypedDict, total=False): - key "catalogDigest": str - key "pipelineResourceId": str - key "source": ForwardRef('PipelineRunSourceProperties', module='types') - key "target": ForwardRef('PipelineRunTargetProperties', module='types') - artifacts: list[str] - catalogDigest: str - pipelineResourceId: str - source: PipelineRunSourceProperties - target: PipelineRunTargetProperties - - - class azure.mgmt.containerregistry.types.PipelineRunResponse(TypedDict, total=False): - key "catalogDigest": str - key "finishTime": str - key "pipelineRunErrorMessage": str - key "progress": ForwardRef('ProgressProperties', module='types') - key "source": ForwardRef('ImportPipelineSourceProperties', module='types') - key "startTime": str - key "status": str - key "target": ForwardRef('ExportPipelineTargetProperties', module='types') - key "trigger": ForwardRef('PipelineTriggerDescriptor', module='types') - catalogDigest: str - finishTime: str - importedArtifacts: list[str] - pipelineRunErrorMessage: str - progress: ProgressProperties - source: ImportPipelineSourceProperties - startTime: str - status: str - target: ExportPipelineTargetProperties - trigger: PipelineTriggerDescriptor - - - class azure.mgmt.containerregistry.types.PipelineRunSourceProperties(TypedDict, total=False): - key "name": str - key "type": Union[str, PipelineRunSourceType] - name: str - type: Union[str, PipelineRunSourceType] - - - class azure.mgmt.containerregistry.types.PipelineRunTargetProperties(TypedDict, total=False): - key "name": str - key "type": Union[str, PipelineRunTargetType] - name: str - type: Union[str, PipelineRunTargetType] - - - class azure.mgmt.containerregistry.types.PipelineSourceTriggerDescriptor(TypedDict, total=False): - key "timestamp": str - timestamp: str - - - class azure.mgmt.containerregistry.types.PipelineSourceTriggerProperties(TypedDict, total=False): - key "status": Required[Union[str, TriggerStatus]] - status: Union[str, TriggerStatus] - - - class azure.mgmt.containerregistry.types.PipelineTriggerDescriptor(TypedDict, total=False): - key "sourceTrigger": ForwardRef('PipelineSourceTriggerDescriptor', module='types') - sourceTrigger: PipelineSourceTriggerDescriptor - - - class azure.mgmt.containerregistry.types.PipelineTriggerProperties(TypedDict, total=False): - key "sourceTrigger": ForwardRef('PipelineSourceTriggerProperties', module='types') - sourceTrigger: PipelineSourceTriggerProperties - - class azure.mgmt.containerregistry.types.Policies(TypedDict, total=False): key "azureADAuthenticationAsArmPolicy": ForwardRef('AzureADAuthenticationAsArmPolicy', module='types') key "exportPolicy": ForwardRef('ExportPolicy', module='types') key "quarantinePolicy": ForwardRef('QuarantinePolicy', module='types') key "retentionPolicy": ForwardRef('RetentionPolicy', module='types') - key "softDeletePolicy": ForwardRef('SoftDeletePolicy', module='types') key "trustPolicy": ForwardRef('TrustPolicy', module='types') azureADAuthenticationAsArmPolicy: AzureADAuthenticationAsArmPolicy exportPolicy: ExportPolicy quarantinePolicy: QuarantinePolicy retentionPolicy: RetentionPolicy - softDeletePolicy: SoftDeletePolicy trustPolicy: TrustPolicy @@ -6770,11 +4839,6 @@ namespace azure.mgmt.containerregistry.types status: Union[str, ConnectionStatus] - class azure.mgmt.containerregistry.types.ProgressProperties(TypedDict, total=False): - key "percentage": str - percentage: str - - class azure.mgmt.containerregistry.types.ProxyResource(Resource): key "id": str key "name": str @@ -6817,26 +4881,20 @@ namespace azure.mgmt.containerregistry.types class azure.mgmt.containerregistry.types.RegistryNameCheckRequest(TypedDict, total=False): - key "autoGeneratedDomainNameLabelScope": Union[str, AutoGeneratedDomainNameLabelScope] key "name": Required[str] - key "resourceGroupName": str key "type": Required[Union[str, ContainerRegistryResourceType]] - autoGeneratedDomainNameLabelScope: Union[str, AutoGeneratedDomainNameLabelScope] name: str - resourceGroupName: str type: Union[str, ContainerRegistryResourceType] class azure.mgmt.containerregistry.types.RegistryProperties(TypedDict, total=False): key "adminUserEnabled": bool key "anonymousPullEnabled": bool - key "autoGeneratedDomainNameLabelScope": Union[str, AutoGeneratedDomainNameLabelScope] key "creationDate": str key "dataEndpointEnabled": bool key "encryption": ForwardRef('EncryptionProperty', module='types') key "endpointProtocol": Union[str, EndpointProtocol] key "loginServer": str - key "metadataSearch": Union[str, MetadataSearch] key "networkRuleBypassAllowedForTasks": bool key "networkRuleBypassOptions": Union[str, NetworkRuleBypassOptions] key "networkRuleSet": ForwardRef('NetworkRuleSet', module='types') @@ -6846,18 +4904,15 @@ namespace azure.mgmt.containerregistry.types key "regionalEndpoints": Union[str, RegionalEndpoints] key "roleAssignmentMode": Union[str, RoleAssignmentMode] key "status": ForwardRef('Status', module='types') - key "writableCacheRepos": Union[str, WritableCacheRepos] key "zoneRedundancy": Union[str, ZoneRedundancy] adminUserEnabled: bool anonymousPullEnabled: bool - autoGeneratedDomainNameLabelScope: Union[str, AutoGeneratedDomainNameLabelScope] creationDate: str dataEndpointEnabled: bool dataEndpointHostNames: list[str] encryption: EncryptionProperty endpointProtocol: Union[str, EndpointProtocol] loginServer: str - metadataSearch: Union[str, MetadataSearch] networkRuleBypassAllowedForTasks: bool networkRuleBypassOptions: Union[str, NetworkRuleBypassOptions] networkRuleSet: NetworkRuleSet @@ -6869,7 +4924,6 @@ namespace azure.mgmt.containerregistry.types regionalEndpoints: Union[str, RegionalEndpoints] roleAssignmentMode: Union[str, RoleAssignmentMode] status: Status - writableCacheRepos: Union[str, WritableCacheRepos] zoneRedundancy: Union[str, ZoneRedundancy] @@ -6879,7 +4933,6 @@ namespace azure.mgmt.containerregistry.types key "dataEndpointEnabled": bool key "encryption": ForwardRef('EncryptionProperty', module='types') key "endpointProtocol": Union[str, EndpointProtocol] - key "metadataSearch": Union[str, MetadataSearch] key "networkRuleBypassAllowedForTasks": bool key "networkRuleBypassOptions": Union[str, NetworkRuleBypassOptions] key "networkRuleSet": ForwardRef('NetworkRuleSet', module='types') @@ -6887,13 +4940,11 @@ namespace azure.mgmt.containerregistry.types key "publicNetworkAccess": Union[str, PublicNetworkAccess] key "regionalEndpoints": Union[str, RegionalEndpoints] key "roleAssignmentMode": Union[str, RoleAssignmentMode] - key "writableCacheRepos": Union[str, WritableCacheRepos] adminUserEnabled: bool anonymousPullEnabled: bool dataEndpointEnabled: bool encryption: EncryptionProperty endpointProtocol: Union[str, EndpointProtocol] - metadataSearch: Union[str, MetadataSearch] networkRuleBypassAllowedForTasks: bool networkRuleBypassOptions: Union[str, NetworkRuleBypassOptions] networkRuleSet: NetworkRuleSet @@ -6901,20 +4952,6 @@ namespace azure.mgmt.containerregistry.types publicNetworkAccess: Union[str, PublicNetworkAccess] regionalEndpoints: Union[str, RegionalEndpoints] roleAssignmentMode: Union[str, RoleAssignmentMode] - writableCacheRepos: Union[str, WritableCacheRepos] - - - class azure.mgmt.containerregistry.types.RegistrySyncResult(TypedDict, total=False): - key "lastSuccessfulSyncEndTime": str - key "lastSyncEndTime": str - key "lastSyncStartTime": str - key "syncState": Required[Union[str, SyncState]] - key "syncTrigger": Required[Union[str, SyncTrigger]] - lastSuccessfulSyncEndTime: str - lastSyncEndTime: str - lastSyncStartTime: str - syncState: Union[str, SyncState] - syncTrigger: Union[str, SyncTrigger] class azure.mgmt.containerregistry.types.RegistryUpdateParameters(TypedDict, total=False): @@ -7029,15 +5066,6 @@ namespace azure.mgmt.containerregistry.types tier: Union[str, SkuTier] - class azure.mgmt.containerregistry.types.SoftDeletePolicy(TypedDict, total=False): - key "lastUpdatedTime": str - key "retentionDays": int - key "status": Union[str, PolicyStatus] - lastUpdatedTime: str - retentionDays: int - status: Union[str, PolicyStatus] - - class azure.mgmt.containerregistry.types.Status(TypedDict, total=False): key "displayStatus": str key "message": str @@ -7048,31 +5076,25 @@ namespace azure.mgmt.containerregistry.types class azure.mgmt.containerregistry.types.StatusDetailProperties(TypedDict, total=False): - key "availableGib": float key "code": str key "correlationId": str key "description": str key "timestamp": str - key "totalGib": float key "type": str - availableGib: float code: str correlationId: str description: str timestamp: str - totalGib: float type: str class azure.mgmt.containerregistry.types.SyncProperties(TypedDict, total=False): - key "authType": Union[str, AuthType] key "gatewayEndpoint": str key "lastSyncTime": str key "messageTtl": Required[str] key "schedule": str key "syncWindow": str key "tokenId": str - authType: Union[str, AuthType] gatewayEndpoint: str lastSyncTime: str messageTtl: str @@ -7082,11 +5104,9 @@ namespace azure.mgmt.containerregistry.types class azure.mgmt.containerregistry.types.SyncUpdateProperties(TypedDict, total=False): - key "authType": Union[str, AuthType] key "messageTtl": str key "schedule": str key "syncWindow": str - authType: Union[str, AuthType] messageTtl: str schedule: str syncWindow: str @@ -7209,13 +5229,6 @@ namespace azure.mgmt.containerregistry.types type: Union[str, TrustPolicyType] - class azure.mgmt.containerregistry.types.UserAssignedIdentity(TypedDict, total=False): - key "clientId": str - key "principalId": str - clientId: str - principalId: str - - class azure.mgmt.containerregistry.types.UserIdentityProperties(TypedDict, total=False): key "clientId": str key "principalId": str diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/api.metadata.yml b/sdk/containerregistry/azure-mgmt-containerregistry/api.metadata.yml index 10fa788cca42..20fdd02dd944 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/api.metadata.yml +++ b/sdk/containerregistry/azure-mgmt-containerregistry/api.metadata.yml @@ -1,4 +1,4 @@ -apiHash: edee25b43a331181110541bf7e356d8356be702bf17f66fb3459cb32131c2724 -packageVersion: 15.1.0b4 +apiHash: 939ff3b6ab0b03696412451fdf163eb7e2c27dcaf2068b1c7d37864f56a12b60 +packageVersion: 15.1.0 parserVersion: 0.3.31 pythonVersion: 3.13.18 diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/apiview-properties.json b/sdk/containerregistry/azure-mgmt-containerregistry/apiview-properties.json index ff13e5ae67b9..c9159259b197 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/apiview-properties.json +++ b/sdk/containerregistry/azure-mgmt-containerregistry/apiview-properties.json @@ -3,19 +3,10 @@ "CrossLanguageDefinitionId": { "azure.mgmt.containerregistry.models.ActivationProperties": "Microsoft.ContainerRegistry.ActivationProperties", "azure.mgmt.containerregistry.models.Actor": "Microsoft.ContainerRegistry.Actor", - "azure.mgmt.containerregistry.models.AdditionalAuthenticationProperties": "Microsoft.ContainerRegistry.AdditionalAuthenticationProperties", - "azure.mgmt.containerregistry.models.AdditionalAuthenticationUpdateProperties": "Microsoft.ContainerRegistry.AdditionalAuthenticationUpdateProperties", - "azure.mgmt.containerregistry.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", - "azure.mgmt.containerregistry.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", - "azure.mgmt.containerregistry.models.Archive": "Microsoft.ContainerRegistry.Archive", - "azure.mgmt.containerregistry.models.ArchivePackageSourceProperties": "Microsoft.ContainerRegistry.ArchivePackageSourceProperties", - "azure.mgmt.containerregistry.models.ArchiveProperties": "Microsoft.ContainerRegistry.ArchiveProperties", - "azure.mgmt.containerregistry.models.ArchiveUpdateParameters": "Microsoft.ContainerRegistry.ArchiveUpdateParameters", - "azure.mgmt.containerregistry.models.ArchiveUpdateProperties": "Microsoft.ContainerRegistry.ArchiveUpdateProperties", - "azure.mgmt.containerregistry.models.ArchiveVersion": "Microsoft.ContainerRegistry.ArchiveVersion", - "azure.mgmt.containerregistry.models.ArchiveVersionProperties": "Microsoft.ContainerRegistry.ArchiveVersionProperties", "azure.mgmt.containerregistry.models.AuthCredential": "Microsoft.ContainerRegistry.AuthCredential", "azure.mgmt.containerregistry.models.AzureADAuthenticationAsArmPolicy": "Microsoft.ContainerRegistry.AzureADAuthenticationAsArmPolicy", + "azure.mgmt.containerregistry.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.containerregistry.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", "azure.mgmt.containerregistry.models.CacheRule": "Microsoft.ContainerRegistry.CacheRule", "azure.mgmt.containerregistry.models.CacheRuleProperties": "Microsoft.ContainerRegistry.CacheRuleProperties", "azure.mgmt.containerregistry.models.CacheRuleUpdateParameters": "Microsoft.ContainerRegistry.CacheRuleUpdateParameters", @@ -30,11 +21,7 @@ "azure.mgmt.containerregistry.models.CredentialSetProperties": "Microsoft.ContainerRegistry.CredentialSetProperties", "azure.mgmt.containerregistry.models.CredentialSetUpdateParameters": "Microsoft.ContainerRegistry.CredentialSetUpdateParameters", "azure.mgmt.containerregistry.models.CredentialSetUpdateProperties": "Microsoft.ContainerRegistry.CredentialSetUpdateProperties", - "azure.mgmt.containerregistry.models.EcrAuthenticationProperties": "Microsoft.ContainerRegistry.EcrAuthenticationProperties", - "azure.mgmt.containerregistry.models.EcrAuthenticationUpdateProperties": "Microsoft.ContainerRegistry.EcrAuthenticationUpdateProperties", "azure.mgmt.containerregistry.models.EncryptionProperty": "Microsoft.ContainerRegistry.EncryptionProperty", - "azure.mgmt.containerregistry.models.EntraFederatedIdentityCredentialAuthenticationProperties": "Microsoft.ContainerRegistry.EntraFederatedIdentityCredentialAuthenticationProperties", - "azure.mgmt.containerregistry.models.EntraFederatedIdentityCredentialAuthenticationUpdateProperties": "Microsoft.ContainerRegistry.EntraFederatedIdentityCredentialAuthenticationUpdateProperties", "azure.mgmt.containerregistry.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.containerregistry.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.containerregistry.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", @@ -43,27 +30,18 @@ "azure.mgmt.containerregistry.models.EventContent": "Microsoft.ContainerRegistry.EventContent", "azure.mgmt.containerregistry.models.EventRequestMessage": "Microsoft.ContainerRegistry.EventRequestMessage", "azure.mgmt.containerregistry.models.EventResponseMessage": "Microsoft.ContainerRegistry.EventResponseMessage", - "azure.mgmt.containerregistry.models.ExportPipeline": "Microsoft.ContainerRegistry.ExportPipeline", - "azure.mgmt.containerregistry.models.ExportPipelineProperties": "Microsoft.ContainerRegistry.ExportPipelineProperties", - "azure.mgmt.containerregistry.models.ExportPipelineTargetProperties": "Microsoft.ContainerRegistry.ExportPipelineTargetProperties", "azure.mgmt.containerregistry.models.ExportPolicy": "Microsoft.ContainerRegistry.ExportPolicy", - "azure.mgmt.containerregistry.models.GarAuthenticationProperties": "Microsoft.ContainerRegistry.GarAuthenticationProperties", - "azure.mgmt.containerregistry.models.GarAuthenticationUpdateProperties": "Microsoft.ContainerRegistry.GarAuthenticationUpdateProperties", "azure.mgmt.containerregistry.models.GarbageCollectionProperties": "Microsoft.ContainerRegistry.GarbageCollectionProperties", "azure.mgmt.containerregistry.models.GenerateCredentialsParameters": "Microsoft.ContainerRegistry.GenerateCredentialsParameters", "azure.mgmt.containerregistry.models.GenerateCredentialsResult": "Microsoft.ContainerRegistry.GenerateCredentialsResult", "azure.mgmt.containerregistry.models.IdentityProperties": "Microsoft.ContainerRegistry.IdentityProperties", "azure.mgmt.containerregistry.models.ImportImageParameters": "Microsoft.ContainerRegistry.ImportImageParameters", - "azure.mgmt.containerregistry.models.ImportPipeline": "Microsoft.ContainerRegistry.ImportPipeline", - "azure.mgmt.containerregistry.models.ImportPipelineProperties": "Microsoft.ContainerRegistry.ImportPipelineProperties", - "azure.mgmt.containerregistry.models.ImportPipelineSourceProperties": "Microsoft.ContainerRegistry.ImportPipelineSourceProperties", "azure.mgmt.containerregistry.models.ImportSource": "Microsoft.ContainerRegistry.ImportSource", "azure.mgmt.containerregistry.models.ImportSourceCredentials": "Microsoft.ContainerRegistry.ImportSourceCredentials", "azure.mgmt.containerregistry.models.IPRule": "Microsoft.ContainerRegistry.IPRule", "azure.mgmt.containerregistry.models.KeyVaultProperties": "Microsoft.ContainerRegistry.KeyVaultProperties", "azure.mgmt.containerregistry.models.LoggingProperties": "Microsoft.ContainerRegistry.LoggingProperties", "azure.mgmt.containerregistry.models.LoginServerProperties": "Microsoft.ContainerRegistry.LoginServerProperties", - "azure.mgmt.containerregistry.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", "azure.mgmt.containerregistry.models.NetworkRuleSet": "Microsoft.ContainerRegistry.NetworkRuleSet", "azure.mgmt.containerregistry.models.OperationDefinition": "Microsoft.ContainerRegistry.OperationDefinition", "azure.mgmt.containerregistry.models.OperationDisplayDefinition": "Microsoft.ContainerRegistry.OperationDisplayDefinition", @@ -72,16 +50,6 @@ "azure.mgmt.containerregistry.models.OperationPropertiesDefinition": "Microsoft.ContainerRegistry.OperationPropertiesDefinition", "azure.mgmt.containerregistry.models.OperationServiceSpecificationDefinition": "Microsoft.ContainerRegistry.OperationServiceSpecificationDefinition", "azure.mgmt.containerregistry.models.ParentProperties": "Microsoft.ContainerRegistry.ParentProperties", - "azure.mgmt.containerregistry.models.PipelineRun": "Microsoft.ContainerRegistry.PipelineRun", - "azure.mgmt.containerregistry.models.PipelineRunProperties": "Microsoft.ContainerRegistry.PipelineRunProperties", - "azure.mgmt.containerregistry.models.PipelineRunRequest": "Microsoft.ContainerRegistry.PipelineRunRequest", - "azure.mgmt.containerregistry.models.PipelineRunResponse": "Microsoft.ContainerRegistry.PipelineRunResponse", - "azure.mgmt.containerregistry.models.PipelineRunSourceProperties": "Microsoft.ContainerRegistry.PipelineRunSourceProperties", - "azure.mgmt.containerregistry.models.PipelineRunTargetProperties": "Microsoft.ContainerRegistry.PipelineRunTargetProperties", - "azure.mgmt.containerregistry.models.PipelineSourceTriggerDescriptor": "Microsoft.ContainerRegistry.PipelineSourceTriggerDescriptor", - "azure.mgmt.containerregistry.models.PipelineSourceTriggerProperties": "Microsoft.ContainerRegistry.PipelineSourceTriggerProperties", - "azure.mgmt.containerregistry.models.PipelineTriggerDescriptor": "Microsoft.ContainerRegistry.PipelineTriggerDescriptor", - "azure.mgmt.containerregistry.models.PipelineTriggerProperties": "Microsoft.ContainerRegistry.PipelineTriggerProperties", "azure.mgmt.containerregistry.models.Policies": "Microsoft.ContainerRegistry.Policies", "azure.mgmt.containerregistry.models.PrivateEndpoint": "Microsoft.ContainerRegistry.PrivateEndpoint", "azure.mgmt.containerregistry.models.PrivateEndpointConnection": "Microsoft.ContainerRegistry.PrivateEndpointConnection", @@ -89,7 +57,6 @@ "azure.mgmt.containerregistry.models.PrivateLinkResource": "Microsoft.ContainerRegistry.MyPrivateLinkResource", "azure.mgmt.containerregistry.models.PrivateLinkResourceProperties": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", "azure.mgmt.containerregistry.models.PrivateLinkServiceConnectionState": "Microsoft.ContainerRegistry.PrivateLinkServiceConnectionState", - "azure.mgmt.containerregistry.models.ProgressProperties": "Microsoft.ContainerRegistry.ProgressProperties", "azure.mgmt.containerregistry.models.QuarantinePolicy": "Microsoft.ContainerRegistry.QuarantinePolicy", "azure.mgmt.containerregistry.models.RegenerateCredentialParameters": "Microsoft.ContainerRegistry.RegenerateCredentialParameters", "azure.mgmt.containerregistry.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", @@ -100,7 +67,6 @@ "azure.mgmt.containerregistry.models.RegistryPassword": "Microsoft.ContainerRegistry.RegistryPassword", "azure.mgmt.containerregistry.models.RegistryProperties": "Microsoft.ContainerRegistry.RegistryProperties", "azure.mgmt.containerregistry.models.RegistryPropertiesUpdateParameters": "Microsoft.ContainerRegistry.RegistryPropertiesUpdateParameters", - "azure.mgmt.containerregistry.models.RegistrySyncResult": "Microsoft.ContainerRegistry.RegistrySyncResult", "azure.mgmt.containerregistry.models.RegistryUpdateParameters": "Microsoft.ContainerRegistry.RegistryUpdateParameters", "azure.mgmt.containerregistry.models.RegistryUsage": "Microsoft.ContainerRegistry.RegistryUsage", "azure.mgmt.containerregistry.models.RegistryUsageListResult": "Microsoft.ContainerRegistry.RegistryUsageListResult", @@ -115,7 +81,6 @@ "azure.mgmt.containerregistry.models.ScopeMapPropertiesUpdateParameters": "Microsoft.ContainerRegistry.ScopeMapPropertiesUpdateParameters", "azure.mgmt.containerregistry.models.ScopeMapUpdateParameters": "Microsoft.ContainerRegistry.ScopeMapUpdateParameters", "azure.mgmt.containerregistry.models.Sku": "Microsoft.ContainerRegistry.Sku", - "azure.mgmt.containerregistry.models.SoftDeletePolicy": "Microsoft.ContainerRegistry.SoftDeletePolicy", "azure.mgmt.containerregistry.models.Source": "Microsoft.ContainerRegistry.Source", "azure.mgmt.containerregistry.models.Status": "Microsoft.ContainerRegistry.Status", "azure.mgmt.containerregistry.models.StatusDetailProperties": "Microsoft.ContainerRegistry.StatusDetailProperties", @@ -133,7 +98,6 @@ "azure.mgmt.containerregistry.models.TokenUpdateParameters": "Microsoft.ContainerRegistry.TokenUpdateParameters", "azure.mgmt.containerregistry.models.TokenUpdateProperties": "Microsoft.ContainerRegistry.TokenUpdateProperties", "azure.mgmt.containerregistry.models.TrustPolicy": "Microsoft.ContainerRegistry.TrustPolicy", - "azure.mgmt.containerregistry.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", "azure.mgmt.containerregistry.models.UserIdentityProperties": "Microsoft.ContainerRegistry.UserIdentityProperties", "azure.mgmt.containerregistry.models.VirtualNetworkRule": "Microsoft.ContainerRegistry.VirtualNetworkRule", "azure.mgmt.containerregistry.models.Webhook": "Microsoft.ContainerRegistry.Webhook", @@ -158,9 +122,6 @@ "azure.mgmt.containerregistry.models.PublicNetworkAccess": "Microsoft.ContainerRegistry.PublicNetworkAccess", "azure.mgmt.containerregistry.models.NetworkRuleBypassOptions": "Microsoft.ContainerRegistry.NetworkRuleBypassOptions", "azure.mgmt.containerregistry.models.ZoneRedundancy": "Microsoft.ContainerRegistry.ZoneRedundancy", - "azure.mgmt.containerregistry.models.MetadataSearch": "Microsoft.ContainerRegistry.MetadataSearch", - "azure.mgmt.containerregistry.models.AutoGeneratedDomainNameLabelScope": "Microsoft.ContainerRegistry.AutoGeneratedDomainNameLabelScope", - "azure.mgmt.containerregistry.models.WritableCacheRepos": "Microsoft.ContainerRegistry.WritableCacheRepos", "azure.mgmt.containerregistry.models.RoleAssignmentMode": "Microsoft.ContainerRegistry.RoleAssignmentMode", "azure.mgmt.containerregistry.models.SkuName": "Microsoft.ContainerRegistry.SkuName", "azure.mgmt.containerregistry.models.SkuTier": "Microsoft.ContainerRegistry.SkuTier", @@ -170,29 +131,17 @@ "azure.mgmt.containerregistry.models.PasswordName": "Microsoft.ContainerRegistry.PasswordName", "azure.mgmt.containerregistry.models.TokenPasswordName": "Microsoft.ContainerRegistry.TokenPasswordName", "azure.mgmt.containerregistry.models.ContainerRegistryResourceType": "Microsoft.ContainerRegistry.ContainerRegistryResourceType", - "azure.mgmt.containerregistry.models.PackageSourceType": "Microsoft.ContainerRegistry.PackageSourceType", - "azure.mgmt.containerregistry.models.AdditionalAuthenticationType": "Microsoft.ContainerRegistry.AdditionalAuthenticationType", "azure.mgmt.containerregistry.models.CredentialName": "Microsoft.ContainerRegistry.CredentialName", "azure.mgmt.containerregistry.models.CredentialHealthStatus": "Microsoft.ContainerRegistry.CredentialHealthStatus", "azure.mgmt.containerregistry.models.ConnectedRegistryMode": "Microsoft.ContainerRegistry.ConnectedRegistryMode", "azure.mgmt.containerregistry.models.ConnectionState": "Microsoft.ContainerRegistry.ConnectionState", "azure.mgmt.containerregistry.models.ActivationStatus": "Microsoft.ContainerRegistry.ActivationStatus", - "azure.mgmt.containerregistry.models.AuthType": "Microsoft.ContainerRegistry.AuthType", "azure.mgmt.containerregistry.models.TlsStatus": "Microsoft.ContainerRegistry.TlsStatus", "azure.mgmt.containerregistry.models.CertificateType": "Microsoft.ContainerRegistry.CertificateType", "azure.mgmt.containerregistry.models.LogLevel": "Microsoft.ContainerRegistry.LogLevel", "azure.mgmt.containerregistry.models.AuditLogStatus": "Microsoft.ContainerRegistry.AuditLogStatus", - "azure.mgmt.containerregistry.models.SyncTrigger": "Microsoft.ContainerRegistry.SyncTrigger", - "azure.mgmt.containerregistry.models.SyncState": "Microsoft.ContainerRegistry.SyncState", - "azure.mgmt.containerregistry.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", "azure.mgmt.containerregistry.models.TokenCertificateName": "Microsoft.ContainerRegistry.TokenCertificateName", "azure.mgmt.containerregistry.models.TokenStatus": "Microsoft.ContainerRegistry.TokenStatus", - "azure.mgmt.containerregistry.models.StorageAccessMode": "Microsoft.ContainerRegistry.StorageAccessMode", - "azure.mgmt.containerregistry.models.PipelineOptions": "Microsoft.ContainerRegistry.PipelineOptions", - "azure.mgmt.containerregistry.models.PipelineSourceType": "Microsoft.ContainerRegistry.PipelineSourceType", - "azure.mgmt.containerregistry.models.TriggerStatus": "Microsoft.ContainerRegistry.TriggerStatus", - "azure.mgmt.containerregistry.models.PipelineRunSourceType": "Microsoft.ContainerRegistry.PipelineRunSourceType", - "azure.mgmt.containerregistry.models.PipelineRunTargetType": "Microsoft.ContainerRegistry.PipelineRunTargetType", "azure.mgmt.containerregistry.models.WebhookStatus": "Microsoft.ContainerRegistry.WebhookStatus", "azure.mgmt.containerregistry.models.WebhookAction": "Microsoft.ContainerRegistry.WebhookAction", "azure.mgmt.containerregistry.operations.Operations.list": "Azure.ResourceManager.Legacy.Operations.list", @@ -225,24 +174,6 @@ "azure.mgmt.containerregistry.aio.operations.RegistriesOperations.get_private_link_resource": "Microsoft.ContainerRegistry.PrivateLinkResources.getPrivateLinkResource", "azure.mgmt.containerregistry.operations.RegistriesOperations.list_private_link_resources": "Microsoft.ContainerRegistry.PrivateLinkResources.listPrivateLinkResources", "azure.mgmt.containerregistry.aio.operations.RegistriesOperations.list_private_link_resources": "Microsoft.ContainerRegistry.PrivateLinkResources.listPrivateLinkResources", - "azure.mgmt.containerregistry.operations.ArchivesOperations.get": "Microsoft.ContainerRegistry.Archives.get", - "azure.mgmt.containerregistry.aio.operations.ArchivesOperations.get": "Microsoft.ContainerRegistry.Archives.get", - "azure.mgmt.containerregistry.operations.ArchivesOperations.begin_create": "Microsoft.ContainerRegistry.Archives.create", - "azure.mgmt.containerregistry.aio.operations.ArchivesOperations.begin_create": "Microsoft.ContainerRegistry.Archives.create", - "azure.mgmt.containerregistry.operations.ArchivesOperations.update": "Microsoft.ContainerRegistry.Archives.update", - "azure.mgmt.containerregistry.aio.operations.ArchivesOperations.update": "Microsoft.ContainerRegistry.Archives.update", - "azure.mgmt.containerregistry.operations.ArchivesOperations.begin_delete": "Microsoft.ContainerRegistry.Archives.delete", - "azure.mgmt.containerregistry.aio.operations.ArchivesOperations.begin_delete": "Microsoft.ContainerRegistry.Archives.delete", - "azure.mgmt.containerregistry.operations.ArchivesOperations.list": "Microsoft.ContainerRegistry.Archives.list", - "azure.mgmt.containerregistry.aio.operations.ArchivesOperations.list": "Microsoft.ContainerRegistry.Archives.list", - "azure.mgmt.containerregistry.operations.ArchiveVersionsOperations.get": "Microsoft.ContainerRegistry.ArchiveVersions.get", - "azure.mgmt.containerregistry.aio.operations.ArchiveVersionsOperations.get": "Microsoft.ContainerRegistry.ArchiveVersions.get", - "azure.mgmt.containerregistry.operations.ArchiveVersionsOperations.begin_create": "Microsoft.ContainerRegistry.ArchiveVersions.create", - "azure.mgmt.containerregistry.aio.operations.ArchiveVersionsOperations.begin_create": "Microsoft.ContainerRegistry.ArchiveVersions.create", - "azure.mgmt.containerregistry.operations.ArchiveVersionsOperations.begin_delete": "Microsoft.ContainerRegistry.ArchiveVersions.delete", - "azure.mgmt.containerregistry.aio.operations.ArchiveVersionsOperations.begin_delete": "Microsoft.ContainerRegistry.ArchiveVersions.delete", - "azure.mgmt.containerregistry.operations.ArchiveVersionsOperations.list": "Microsoft.ContainerRegistry.ArchiveVersions.list", - "azure.mgmt.containerregistry.aio.operations.ArchiveVersionsOperations.list": "Microsoft.ContainerRegistry.ArchiveVersions.list", "azure.mgmt.containerregistry.operations.CacheRulesOperations.get": "Microsoft.ContainerRegistry.CacheRules.get", "azure.mgmt.containerregistry.aio.operations.CacheRulesOperations.get": "Microsoft.ContainerRegistry.CacheRules.get", "azure.mgmt.containerregistry.operations.CacheRulesOperations.begin_create": "Microsoft.ContainerRegistry.CacheRules.create", @@ -275,8 +206,6 @@ "azure.mgmt.containerregistry.aio.operations.ConnectedRegistriesOperations.list": "Microsoft.ContainerRegistry.ConnectedRegistries.list", "azure.mgmt.containerregistry.operations.ConnectedRegistriesOperations.begin_deactivate": "Microsoft.ContainerRegistry.ConnectedRegistries.deactivate", "azure.mgmt.containerregistry.aio.operations.ConnectedRegistriesOperations.begin_deactivate": "Microsoft.ContainerRegistry.ConnectedRegistries.deactivate", - "azure.mgmt.containerregistry.operations.ConnectedRegistriesOperations.resync": "Microsoft.ContainerRegistry.ConnectedRegistries.resync", - "azure.mgmt.containerregistry.aio.operations.ConnectedRegistriesOperations.resync": "Microsoft.ContainerRegistry.ConnectedRegistries.resync", "azure.mgmt.containerregistry.operations.PrivateEndpointConnectionsOperations.get": "Microsoft.ContainerRegistry.PrivateEndpointConnections.get", "azure.mgmt.containerregistry.aio.operations.PrivateEndpointConnectionsOperations.get": "Microsoft.ContainerRegistry.PrivateEndpointConnections.get", "azure.mgmt.containerregistry.operations.PrivateEndpointConnectionsOperations.begin_create_or_update": "Microsoft.ContainerRegistry.PrivateEndpointConnections.createOrUpdate", @@ -315,30 +244,6 @@ "azure.mgmt.containerregistry.aio.operations.TokensOperations.begin_delete": "Microsoft.ContainerRegistry.Tokens.delete", "azure.mgmt.containerregistry.operations.TokensOperations.list": "Microsoft.ContainerRegistry.Tokens.list", "azure.mgmt.containerregistry.aio.operations.TokensOperations.list": "Microsoft.ContainerRegistry.Tokens.list", - "azure.mgmt.containerregistry.operations.ExportPipelinesOperations.get": "Microsoft.ContainerRegistry.ExportPipelines.get", - "azure.mgmt.containerregistry.aio.operations.ExportPipelinesOperations.get": "Microsoft.ContainerRegistry.ExportPipelines.get", - "azure.mgmt.containerregistry.operations.ExportPipelinesOperations.begin_create": "Microsoft.ContainerRegistry.ExportPipelines.create", - "azure.mgmt.containerregistry.aio.operations.ExportPipelinesOperations.begin_create": "Microsoft.ContainerRegistry.ExportPipelines.create", - "azure.mgmt.containerregistry.operations.ExportPipelinesOperations.begin_delete": "Microsoft.ContainerRegistry.ExportPipelines.delete", - "azure.mgmt.containerregistry.aio.operations.ExportPipelinesOperations.begin_delete": "Microsoft.ContainerRegistry.ExportPipelines.delete", - "azure.mgmt.containerregistry.operations.ExportPipelinesOperations.list": "Microsoft.ContainerRegistry.ExportPipelines.list", - "azure.mgmt.containerregistry.aio.operations.ExportPipelinesOperations.list": "Microsoft.ContainerRegistry.ExportPipelines.list", - "azure.mgmt.containerregistry.operations.ImportPipelinesOperations.get": "Microsoft.ContainerRegistry.ImportPipelines.get", - "azure.mgmt.containerregistry.aio.operations.ImportPipelinesOperations.get": "Microsoft.ContainerRegistry.ImportPipelines.get", - "azure.mgmt.containerregistry.operations.ImportPipelinesOperations.begin_create": "Microsoft.ContainerRegistry.ImportPipelines.create", - "azure.mgmt.containerregistry.aio.operations.ImportPipelinesOperations.begin_create": "Microsoft.ContainerRegistry.ImportPipelines.create", - "azure.mgmt.containerregistry.operations.ImportPipelinesOperations.begin_delete": "Microsoft.ContainerRegistry.ImportPipelines.delete", - "azure.mgmt.containerregistry.aio.operations.ImportPipelinesOperations.begin_delete": "Microsoft.ContainerRegistry.ImportPipelines.delete", - "azure.mgmt.containerregistry.operations.ImportPipelinesOperations.list": "Microsoft.ContainerRegistry.ImportPipelines.list", - "azure.mgmt.containerregistry.aio.operations.ImportPipelinesOperations.list": "Microsoft.ContainerRegistry.ImportPipelines.list", - "azure.mgmt.containerregistry.operations.PipelineRunsOperations.get": "Microsoft.ContainerRegistry.PipelineRuns.get", - "azure.mgmt.containerregistry.aio.operations.PipelineRunsOperations.get": "Microsoft.ContainerRegistry.PipelineRuns.get", - "azure.mgmt.containerregistry.operations.PipelineRunsOperations.begin_create": "Microsoft.ContainerRegistry.PipelineRuns.create", - "azure.mgmt.containerregistry.aio.operations.PipelineRunsOperations.begin_create": "Microsoft.ContainerRegistry.PipelineRuns.create", - "azure.mgmt.containerregistry.operations.PipelineRunsOperations.begin_delete": "Microsoft.ContainerRegistry.PipelineRuns.delete", - "azure.mgmt.containerregistry.aio.operations.PipelineRunsOperations.begin_delete": "Microsoft.ContainerRegistry.PipelineRuns.delete", - "azure.mgmt.containerregistry.operations.PipelineRunsOperations.list": "Microsoft.ContainerRegistry.PipelineRuns.list", - "azure.mgmt.containerregistry.aio.operations.PipelineRunsOperations.list": "Microsoft.ContainerRegistry.PipelineRuns.list", "azure.mgmt.containerregistry.operations.WebhooksOperations.get": "Microsoft.ContainerRegistry.Webhooks.get", "azure.mgmt.containerregistry.aio.operations.WebhooksOperations.get": "Microsoft.ContainerRegistry.Webhooks.get", "azure.mgmt.containerregistry.operations.WebhooksOperations.begin_create": "Microsoft.ContainerRegistry.Webhooks.create", @@ -356,5 +261,5 @@ "azure.mgmt.containerregistry.operations.WebhooksOperations.get_callback_config": "Microsoft.ContainerRegistry.Webhooks.getCallbackConfig", "azure.mgmt.containerregistry.aio.operations.WebhooksOperations.get_callback_config": "Microsoft.ContainerRegistry.Webhooks.getCallbackConfig" }, - "CrossLanguageVersion": "64eba75e352e" + "CrossLanguageVersion": "259774172fe1" } \ No newline at end of file diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_client.py index 9855a2fca0a0..8717ae9840fb 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_client.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_client.py @@ -21,15 +21,10 @@ from ._configuration import ContainerRegistryManagementClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( - ArchiveVersionsOperations, - ArchivesOperations, CacheRulesOperations, ConnectedRegistriesOperations, CredentialSetsOperations, - ExportPipelinesOperations, - ImportPipelinesOperations, Operations, - PipelineRunsOperations, PrivateEndpointConnectionsOperations, RegistriesOperations, ReplicationsOperations, @@ -55,10 +50,6 @@ class ContainerRegistryManagementClient: # pylint: disable=too-many-instance-at :vartype operations: azure.mgmt.containerregistry.operations.Operations :ivar registries: RegistriesOperations operations :vartype registries: azure.mgmt.containerregistry.operations.RegistriesOperations - :ivar archives: ArchivesOperations operations - :vartype archives: azure.mgmt.containerregistry.operations.ArchivesOperations - :ivar archive_versions: ArchiveVersionsOperations operations - :vartype archive_versions: azure.mgmt.containerregistry.operations.ArchiveVersionsOperations :ivar cache_rules: CacheRulesOperations operations :vartype cache_rules: azure.mgmt.containerregistry.operations.CacheRulesOperations :ivar credential_sets: CredentialSetsOperations operations @@ -75,12 +66,6 @@ class ContainerRegistryManagementClient: # pylint: disable=too-many-instance-at :vartype scope_maps: azure.mgmt.containerregistry.operations.ScopeMapsOperations :ivar tokens: TokensOperations operations :vartype tokens: azure.mgmt.containerregistry.operations.TokensOperations - :ivar export_pipelines: ExportPipelinesOperations operations - :vartype export_pipelines: azure.mgmt.containerregistry.operations.ExportPipelinesOperations - :ivar import_pipelines: ImportPipelinesOperations operations - :vartype import_pipelines: azure.mgmt.containerregistry.operations.ImportPipelinesOperations - :ivar pipeline_runs: PipelineRunsOperations operations - :vartype pipeline_runs: azure.mgmt.containerregistry.operations.PipelineRunsOperations :ivar webhooks: WebhooksOperations operations :vartype webhooks: azure.mgmt.containerregistry.operations.WebhooksOperations :param credential: Credential used to authenticate requests to the service. Required. @@ -92,10 +77,9 @@ class ContainerRegistryManagementClient: # pylint: disable=too-many-instance-at :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-10-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -150,10 +134,6 @@ def __init__( self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.archives = ArchivesOperations(self._client, self._config, self._serialize, self._deserialize) - self.archive_versions = ArchiveVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.cache_rules = CacheRulesOperations(self._client, self._config, self._serialize, self._deserialize) self.credential_sets = CredentialSetsOperations(self._client, self._config, self._serialize, self._deserialize) self.connected_registries = ConnectedRegistriesOperations( @@ -165,13 +145,6 @@ def __init__( self.replications = ReplicationsOperations(self._client, self._config, self._serialize, self._deserialize) self.scope_maps = ScopeMapsOperations(self._client, self._config, self._serialize, self._deserialize) self.tokens = TokensOperations(self._client, self._config, self._serialize, self._deserialize) - self.export_pipelines = ExportPipelinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.import_pipelines = ImportPipelinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.pipeline_runs = PipelineRunsOperations(self._client, self._config, self._serialize, self._deserialize) self.webhooks = WebhooksOperations(self._client, self._config, self._serialize, self._deserialize) def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_configuration.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_configuration.py index 5fc9a4699c22..e9ade6a4d4d8 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_configuration.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_configuration.py @@ -34,10 +34,9 @@ class ContainerRegistryManagementClientConfiguration: # pylint: disable=too-man :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-10-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -49,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-10-15-preview") + api_version: str = kwargs.pop("api_version", "2026-11-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_validation.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_validation.py deleted file mode 100644 index f5af3a4eb8a2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_validation.py +++ /dev/null @@ -1,66 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools - - -def api_version_validation(**kwargs): - params_added_on = kwargs.pop("params_added_on", {}) - method_added_on = kwargs.pop("method_added_on", "") - api_versions_list = kwargs.pop("api_versions_list", []) - - def _index_with_default(value: str, default: int = -1) -> int: - """Get the index of value in lst, or return default if not found. - - :param value: The value to search for in the api_versions_list. - :type value: str - :param default: The default value to return if the value is not found. - :type default: int - :return: The index of the value in the list, or the default value if not found. - :rtype: int - """ - try: - return api_versions_list.index(value) - except ValueError: - return default - - def decorator(func): - @functools.wraps(func) - def wrapper(*args, **kwargs): - try: - # this assumes the client has an _api_version attribute - client = args[0] - client_api_version = client._config.api_version # pylint: disable=protected-access - except AttributeError: - return func(*args, **kwargs) - - if _index_with_default(method_added_on) > _index_with_default(client_api_version): - raise ValueError( - f"'{func.__name__}' is not available in API version " - f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." - ) - - unsupported = { - parameter: api_version - for api_version, parameters in params_added_on.items() - for parameter in parameters - if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) - } - if unsupported: - raise ValueError( - "".join( - [ - f"'{param}' is not available in API version {client_api_version}. " - f"Use service API version {version} or newer.\n" - for param, version in unsupported.items() - ] - ) - ) - return func(*args, **kwargs) - - return wrapper - - return decorator diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_version.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_version.py index 67b4dd1d0275..76bba1459abc 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_version.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "15.1.0b4" +VERSION = "15.1.0" diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/_client.py index 6d11066c14c7..6ba11c799c89 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/_client.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/_client.py @@ -21,15 +21,10 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import ContainerRegistryManagementClientConfiguration from .operations import ( - ArchiveVersionsOperations, - ArchivesOperations, CacheRulesOperations, ConnectedRegistriesOperations, CredentialSetsOperations, - ExportPipelinesOperations, - ImportPipelinesOperations, Operations, - PipelineRunsOperations, PrivateEndpointConnectionsOperations, RegistriesOperations, ReplicationsOperations, @@ -55,11 +50,6 @@ class ContainerRegistryManagementClient: # pylint: disable=too-many-instance-at :vartype operations: azure.mgmt.containerregistry.aio.operations.Operations :ivar registries: RegistriesOperations operations :vartype registries: azure.mgmt.containerregistry.aio.operations.RegistriesOperations - :ivar archives: ArchivesOperations operations - :vartype archives: azure.mgmt.containerregistry.aio.operations.ArchivesOperations - :ivar archive_versions: ArchiveVersionsOperations operations - :vartype archive_versions: - azure.mgmt.containerregistry.aio.operations.ArchiveVersionsOperations :ivar cache_rules: CacheRulesOperations operations :vartype cache_rules: azure.mgmt.containerregistry.aio.operations.CacheRulesOperations :ivar credential_sets: CredentialSetsOperations operations @@ -76,14 +66,6 @@ class ContainerRegistryManagementClient: # pylint: disable=too-many-instance-at :vartype scope_maps: azure.mgmt.containerregistry.aio.operations.ScopeMapsOperations :ivar tokens: TokensOperations operations :vartype tokens: azure.mgmt.containerregistry.aio.operations.TokensOperations - :ivar export_pipelines: ExportPipelinesOperations operations - :vartype export_pipelines: - azure.mgmt.containerregistry.aio.operations.ExportPipelinesOperations - :ivar import_pipelines: ImportPipelinesOperations operations - :vartype import_pipelines: - azure.mgmt.containerregistry.aio.operations.ImportPipelinesOperations - :ivar pipeline_runs: PipelineRunsOperations operations - :vartype pipeline_runs: azure.mgmt.containerregistry.aio.operations.PipelineRunsOperations :ivar webhooks: WebhooksOperations operations :vartype webhooks: azure.mgmt.containerregistry.aio.operations.WebhooksOperations :param credential: Credential used to authenticate requests to the service. Required. @@ -95,10 +77,9 @@ class ContainerRegistryManagementClient: # pylint: disable=too-many-instance-at :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-10-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -155,10 +136,6 @@ def __init__( self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.archives = ArchivesOperations(self._client, self._config, self._serialize, self._deserialize) - self.archive_versions = ArchiveVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.cache_rules = CacheRulesOperations(self._client, self._config, self._serialize, self._deserialize) self.credential_sets = CredentialSetsOperations(self._client, self._config, self._serialize, self._deserialize) self.connected_registries = ConnectedRegistriesOperations( @@ -170,13 +147,6 @@ def __init__( self.replications = ReplicationsOperations(self._client, self._config, self._serialize, self._deserialize) self.scope_maps = ScopeMapsOperations(self._client, self._config, self._serialize, self._deserialize) self.tokens = TokensOperations(self._client, self._config, self._serialize, self._deserialize) - self.export_pipelines = ExportPipelinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.import_pipelines = ImportPipelinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.pipeline_runs = PipelineRunsOperations(self._client, self._config, self._serialize, self._deserialize) self.webhooks = WebhooksOperations(self._client, self._config, self._serialize, self._deserialize) def send_request( diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/_configuration.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/_configuration.py index 821c46d71f34..6ebd8acc9f8f 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/_configuration.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/_configuration.py @@ -34,10 +34,9 @@ class ContainerRegistryManagementClientConfiguration: # pylint: disable=too-man :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-10-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -49,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-10-15-preview") + api_version: str = kwargs.pop("api_version", "2026-11-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/operations/__init__.py index a72d40cdc4ef..5dad0f409b6a 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/operations/__init__.py @@ -14,8 +14,6 @@ from ._operations import Operations # type: ignore from ._operations import RegistriesOperations # type: ignore -from ._operations import ArchivesOperations # type: ignore -from ._operations import ArchiveVersionsOperations # type: ignore from ._operations import CacheRulesOperations # type: ignore from ._operations import CredentialSetsOperations # type: ignore from ._operations import ConnectedRegistriesOperations # type: ignore @@ -23,9 +21,6 @@ from ._operations import ReplicationsOperations # type: ignore from ._operations import ScopeMapsOperations # type: ignore from ._operations import TokensOperations # type: ignore -from ._operations import ExportPipelinesOperations # type: ignore -from ._operations import ImportPipelinesOperations # type: ignore -from ._operations import PipelineRunsOperations # type: ignore from ._operations import WebhooksOperations # type: ignore from ._patch import __all__ as _patch_all @@ -35,8 +30,6 @@ __all__ = [ "Operations", "RegistriesOperations", - "ArchivesOperations", - "ArchiveVersionsOperations", "CacheRulesOperations", "CredentialSetsOperations", "ConnectedRegistriesOperations", @@ -44,9 +37,6 @@ "ReplicationsOperations", "ScopeMapsOperations", "TokensOperations", - "ExportPipelinesOperations", - "ImportPipelinesOperations", - "PipelineRunsOperations", "WebhooksOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/operations/_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/operations/_operations.py index a0eeee8fd2c5..301e3dce3ed0 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/operations/_operations.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/operations/_operations.py @@ -36,17 +36,7 @@ from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer -from ..._validation import api_version_validation from ...operations._operations import ( - build_archive_versions_create_request, - build_archive_versions_delete_request, - build_archive_versions_get_request, - build_archive_versions_list_request, - build_archives_create_request, - build_archives_delete_request, - build_archives_get_request, - build_archives_list_request, - build_archives_update_request, build_cache_rules_create_request, build_cache_rules_delete_request, build_cache_rules_get_request, @@ -57,26 +47,13 @@ build_connected_registries_delete_request, build_connected_registries_get_request, build_connected_registries_list_request, - build_connected_registries_resync_request, build_connected_registries_update_request, build_credential_sets_create_request, build_credential_sets_delete_request, build_credential_sets_get_request, build_credential_sets_list_request, build_credential_sets_update_request, - build_export_pipelines_create_request, - build_export_pipelines_delete_request, - build_export_pipelines_get_request, - build_export_pipelines_list_request, - build_import_pipelines_create_request, - build_import_pipelines_delete_request, - build_import_pipelines_get_request, - build_import_pipelines_list_request, build_operations_list_request, - build_pipeline_runs_create_request, - build_pipeline_runs_delete_request, - build_pipeline_runs_get_request, - build_pipeline_runs_list_request, build_private_endpoint_connections_create_or_update_request, build_private_endpoint_connections_delete_request, build_private_endpoint_connections_get_request, @@ -2238,14 +2215,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ArchivesOperations: # pylint: disable=docstring-missing-param +class CacheRulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`archives` attribute. + :attr:`cache_rules` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -2258,37 +2235,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def get( - self, resource_group_name: str, registry_name: str, package_type: str, archive_name: str, **kwargs: Any - ) -> _models.Archive: - """Gets the properties of the archive. + self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any + ) -> _models.CacheRule: + """Gets the properties of the specified cache rule resource. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :return: Archive. The Archive is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Archive + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :return: CacheRule. The CacheRule is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.CacheRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2302,13 +2262,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Archive] = kwargs.pop("cls", None) + cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) - _request = build_archives_get_request( + _request = build_cache_rules_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, + cache_rule_name=cache_rule_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2343,36 +2302,19 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Archive, response.json()) + deserialized = _deserialize(_models.CacheRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def _create_initial( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: Union[_models.Archive, _types.Archive, IO[bytes]], + cache_rule_name: str, + cache_rule_create_parameters: Union[_models.CacheRule, _types.CacheRule, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2391,16 +2333,15 @@ async def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(archive_create_parameters, (IOBase, bytes)): - _content = archive_create_parameters + if isinstance(cache_rule_create_parameters, (IOBase, bytes)): + _content = cache_rule_create_parameters else: - _content = json.dumps(archive_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(cache_rule_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_archives_create_request( + _request = build_cache_rules_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, + cache_rule_name=cache_rule_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2452,32 +2393,29 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: _models.Archive, + cache_rule_name: str, + cache_rule_create_parameters: _models.CacheRule, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Archive]: - """Creates a archive for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.CacheRule]: + """Creates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_create_parameters: The parameters for creating a archive. Required. - :type archive_create_parameters: ~azure.mgmt.containerregistry.models.Archive + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. + :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.models.CacheRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Archive. The Archive is compatible with + :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Archive] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2486,32 +2424,29 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: _types.Archive, + cache_rule_name: str, + cache_rule_create_parameters: _types.CacheRule, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Archive]: - """Creates a archive for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.CacheRule]: + """Creates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_create_parameters: The parameters for creating a archive. Required. - :type archive_create_parameters: ~azure.mgmt.containerregistry.types.Archive + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. + :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.types.CacheRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Archive. The Archive is compatible with + :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Archive] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2520,86 +2455,64 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: IO[bytes], + cache_rule_name: str, + cache_rule_create_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Archive]: - """Creates a archive for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.CacheRule]: + """Creates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_create_parameters: The parameters for creating a archive. Required. - :type archive_create_parameters: IO[bytes] + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. + :type cache_rule_create_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Archive. The Archive is compatible with + :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Archive] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def begin_create( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: Union[_models.Archive, _types.Archive, IO[bytes]], + cache_rule_name: str, + cache_rule_create_parameters: Union[_models.CacheRule, _types.CacheRule, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Archive]: - """Creates a archive for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.CacheRule]: + """Creates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_create_parameters: The parameters for creating a archive. Is either a Archive - type or a IO[bytes] type. Required. - :type archive_create_parameters: ~azure.mgmt.containerregistry.models.Archive or - ~azure.mgmt.containerregistry.types.Archive or IO[bytes] - :return: An instance of AsyncLROPoller that returns Archive. The Archive is compatible with + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_create_parameters: The parameters for creating a cache rule. Is either a + CacheRule type or a IO[bytes] type. Required. + :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.models.CacheRule or + ~azure.mgmt.containerregistry.types.CacheRule or IO[bytes] + :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Archive] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Archive] = kwargs.pop("cls", None) + cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -2607,9 +2520,8 @@ async def begin_create( raw_result = await self._create_initial( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_create_parameters=archive_create_parameters, + cache_rule_name=cache_rule_name, + cache_rule_create_parameters=cache_rule_create_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -2621,7 +2533,7 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Archive, response.json()) + deserialized = _deserialize(_models.CacheRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -2639,245 +2551,277 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Archive].from_continuation_token( + return AsyncLROPoller[_models.CacheRule].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Archive]( + return AsyncLROPoller[_models.CacheRule]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + async def _update_initial( + self, + resource_group_name: str, + registry_name: str, + cache_rule_name: str, + cache_rule_update_parameters: Union[ + _models.CacheRuleUpdateParameters, _types.CacheRuleUpdateParameters, IO[bytes] + ], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(cache_rule_update_parameters, (IOBase, bytes)): + _content = cache_rule_update_parameters + else: + _content = json.dumps(cache_rule_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cache_rules_update_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + cache_rule_name=cache_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - async def update( + async def begin_update( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: _models.ArchiveUpdateParameters, + cache_rule_name: str, + cache_rule_update_parameters: _models.CacheRuleUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Archive: - """Updates a archive for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.CacheRule]: + """Updates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_update_parameters: The parameters for updating a archive. Required. - :type archive_update_parameters: ~azure.mgmt.containerregistry.models.ArchiveUpdateParameters + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. + :type cache_rule_update_parameters: + ~azure.mgmt.containerregistry.models.CacheRuleUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Archive. The Archive is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Archive + :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update( + async def begin_update( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: _types.ArchiveUpdateParameters, + cache_rule_name: str, + cache_rule_update_parameters: _types.CacheRuleUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Archive: - """Updates a archive for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.CacheRule]: + """Updates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_update_parameters: The parameters for updating a archive. Required. - :type archive_update_parameters: ~azure.mgmt.containerregistry.types.ArchiveUpdateParameters + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. + :type cache_rule_update_parameters: + ~azure.mgmt.containerregistry.types.CacheRuleUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Archive. The Archive is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Archive + :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update( + async def begin_update( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: IO[bytes], + cache_rule_name: str, + cache_rule_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Archive: - """Updates a archive for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.CacheRule]: + """Updates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_update_parameters: The parameters for updating a archive. Required. - :type archive_update_parameters: IO[bytes] + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. + :type cache_rule_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: Archive. The Archive is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Archive + :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def update( + async def begin_update( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: Union[_models.ArchiveUpdateParameters, _types.ArchiveUpdateParameters, IO[bytes]], + cache_rule_name: str, + cache_rule_update_parameters: Union[ + _models.CacheRuleUpdateParameters, _types.CacheRuleUpdateParameters, IO[bytes] + ], **kwargs: Any - ) -> _models.Archive: - """Updates a archive for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.CacheRule]: + """Updates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_update_parameters: The parameters for updating a archive. Is either a - ArchiveUpdateParameters type or a IO[bytes] type. Required. - :type archive_update_parameters: ~azure.mgmt.containerregistry.models.ArchiveUpdateParameters - or ~azure.mgmt.containerregistry.types.ArchiveUpdateParameters or IO[bytes] - :return: Archive. The Archive is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Archive + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_update_parameters: The parameters for updating a cache rule. Is either a + CacheRuleUpdateParameters type or a IO[bytes] type. Required. + :type cache_rule_update_parameters: + ~azure.mgmt.containerregistry.models.CacheRuleUpdateParameters or + ~azure.mgmt.containerregistry.types.CacheRuleUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Archive] = kwargs.pop("cls", None) + cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + cache_rule_name=cache_rule_name, + cache_rule_update_parameters=cache_rule_update_parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(archive_update_parameters, (IOBase, bytes)): - _content = archive_update_parameters - else: - _content = json.dumps(archive_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CacheRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_archives_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.Archive, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CacheRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CacheRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def _delete_initial( - self, resource_group_name: str, registry_name: str, package_type: str, archive_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2892,11 +2836,10 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_archives_delete_request( + _request = build_cache_rules_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, + cache_rule_name=cache_rule_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2940,34 +2883,18 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def begin_delete( - self, resource_group_name: str, registry_name: str, package_type: str, archive_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a archive from a container registry. + """Deletes a cache rule resource from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2983,8 +2910,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, + cache_rule_name=cache_rule_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3019,40 +2945,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def list( - self, resource_group_name: str, registry_name: str, package_type: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Archive"]: - """Lists all archives for the specified container registry and package type. + def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> AsyncItemPaged["_models.CacheRule"]: + """Lists all cache rule resources for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :return: An iterator like instance of Archive - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.Archive] + :return: An iterator like instance of CacheRule + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Archive]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CacheRule]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3065,10 +2973,9 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_archives_list_request( + _request = build_cache_rules_list_request( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3109,7 +3016,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Archive], + List[_models.CacheRule], deserialized.get("value", []), ) if cls: @@ -3138,14 +3045,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ArchiveVersionsOperations: # pylint: disable=docstring-missing-param +class CredentialSetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`archive_versions` attribute. + :attr:`credential_sets` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3158,46 +3065,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "archive_version_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def get( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - **kwargs: Any - ) -> _models.ArchiveVersion: - """Gets the properties of the archive version. + self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any + ) -> _models.CredentialSet: + """Gets the properties of the specified credential set resource. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_version_name: The name of the archive version resource. Required. - :type archive_version_name: str - :return: ArchiveVersion. The ArchiveVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ArchiveVersion + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :return: CredentialSet. The CredentialSet is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.CredentialSet :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3211,14 +3092,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ArchiveVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) - _request = build_archive_versions_get_request( + _request = build_credential_sets_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_version_name=archive_version_name, + credential_set_name=credential_set_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3253,36 +3132,19 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ArchiveVersion, response.json()) + deserialized = _deserialize(_models.CredentialSet, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "archive_version_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def _create_initial( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, + credential_set_name: str, + credential_set_create_parameters: Union[_models.CredentialSet, _types.CredentialSet, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3293,19 +3155,27 @@ async def _create_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_archive_versions_create_request( + content_type = content_type or "application/json" + _content = None + if isinstance(credential_set_create_parameters, (IOBase, bytes)): + _content = credential_set_create_parameters + else: + _content = json.dumps(credential_set_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_credential_sets_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_version_name=archive_version_name, + credential_set_name=credential_set_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -3348,54 +3218,134 @@ async def _create_initial( return deserialized # type: ignore + @overload + async def begin_create( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_create_parameters: _models.CredentialSet, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CredentialSet]: + """Creates a credential set for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_create_parameters: The parameters for creating a credential set. + Required. + :type credential_set_create_parameters: ~azure.mgmt.containerregistry.models.CredentialSet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_create_parameters: _types.CredentialSet, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CredentialSet]: + """Creates a credential set for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_create_parameters: The parameters for creating a credential set. + Required. + :type credential_set_create_parameters: ~azure.mgmt.containerregistry.types.CredentialSet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_create_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CredentialSet]: + """Creates a credential set for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_create_parameters: The parameters for creating a credential set. + Required. + :type credential_set_create_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "archive_version_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def begin_create( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, + credential_set_name: str, + credential_set_create_parameters: Union[_models.CredentialSet, _types.CredentialSet, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.ArchiveVersion]: - """Creates a archive version for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.CredentialSet]: + """Creates a credential set for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_version_name: The name of the archive version resource. Required. - :type archive_version_name: str - :return: An instance of AsyncLROPoller that returns ArchiveVersion. The ArchiveVersion is + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_create_parameters: The parameters for creating a credential set. Is + either a CredentialSet type or a IO[bytes] type. Required. + :type credential_set_create_parameters: ~azure.mgmt.containerregistry.models.CredentialSet or + ~azure.mgmt.containerregistry.types.CredentialSet or IO[bytes] + :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ArchiveVersion] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ArchiveVersion] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -3403,9 +3353,9 @@ async def begin_create( raw_result = await self._create_initial( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_version_name=archive_version_name, + credential_set_name=credential_set_name, + credential_set_create_parameters=credential_set_create_parameters, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3416,7 +3366,7 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ArchiveVersion, response.json()) + deserialized = _deserialize(_models.CredentialSet, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3434,38 +3384,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.ArchiveVersion].from_continuation_token( + return AsyncLROPoller[_models.CredentialSet].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.ArchiveVersion]( + return AsyncLROPoller[_models.CredentialSet]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "archive_version_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def _delete_initial( + async def _update_initial( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, + credential_set_name: str, + credential_set_update_parameters: Union[ + _models.CredentialSetUpdateParameters, _types.CredentialSetUpdateParameters, IO[bytes] + ], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3476,19 +3412,27 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_archive_versions_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(credential_set_update_parameters, (IOBase, bytes)): + _content = credential_set_update_parameters + else: + _content = json.dumps(credential_set_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_credential_sets_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_version_name=archive_version_name, + credential_set_name=credential_set_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -3505,7 +3449,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -3518,8 +3462,10 @@ async def _delete_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -3529,46 +3475,264 @@ async def _delete_initial( return deserialized # type: ignore - @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "archive_version_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def begin_delete( + @overload + async def begin_update( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, + credential_set_name: str, + credential_set_update_parameters: _models.CredentialSetUpdateParameters, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a archive version from a container registry. + ) -> AsyncLROPoller[_models.CredentialSet]: + """Updates a credential set for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_version_name: The name of the archive version resource. Required. - :type archive_version_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_update_parameters: The parameters for updating a credential set. + Required. + :type credential_set_update_parameters: + ~azure.mgmt.containerregistry.models.CredentialSetUpdateParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_update_parameters: _types.CredentialSetUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CredentialSet]: + """Updates a credential set for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_update_parameters: The parameters for updating a credential set. + Required. + :type credential_set_update_parameters: + ~azure.mgmt.containerregistry.types.CredentialSetUpdateParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_update_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CredentialSet]: + """Updates a credential set for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_update_parameters: The parameters for updating a credential set. + Required. + :type credential_set_update_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_update_parameters: Union[ + _models.CredentialSetUpdateParameters, _types.CredentialSetUpdateParameters, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.CredentialSet]: + """Updates a credential set for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_update_parameters: The parameters for updating a credential set. Is + either a CredentialSetUpdateParameters type or a IO[bytes] type. Required. + :type credential_set_update_parameters: + ~azure.mgmt.containerregistry.models.CredentialSetUpdateParameters or + ~azure.mgmt.containerregistry.types.CredentialSetUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + credential_set_name=credential_set_name, + credential_set_update_parameters=credential_set_update_parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CredentialSet, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CredentialSet].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CredentialSet]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_credential_sets_delete_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + credential_set_name=credential_set_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a credential set from a container registry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} @@ -3582,9 +3746,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_version_name=archive_version_name, + credential_set_name=credential_set_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3619,45 +3781,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) def list( - self, resource_group_name: str, registry_name: str, package_type: str, archive_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ArchiveVersion"]: - """Lists all archive versions for the specified container registry, repository type and archive - name. + self, resource_group_name: str, registry_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.CredentialSet"]: + """Lists all credential set resources for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :return: An iterator like instance of ArchiveVersion + :return: An iterator like instance of CredentialSet :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.ArchiveVersion] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.CredentialSet] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ArchiveVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CredentialSet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3670,11 +3812,9 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_archive_versions_list_request( + _request = build_credential_sets_list_request( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3715,7 +3855,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ArchiveVersion], + List[_models.CredentialSet], deserialized.get("value", []), ) if cls: @@ -3744,14 +3884,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class CacheRulesOperations: # pylint: disable=docstring-missing-param +class ConnectedRegistriesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`cache_rules` attribute. + :attr:`connected_registries` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3765,19 +3905,19 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any - ) -> _models.CacheRule: - """Gets the properties of the specified cache rule resource. + self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any + ) -> _models.ConnectedRegistry: + """Gets the properties of the connected registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :return: CacheRule. The CacheRule is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.CacheRule + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :return: ConnectedRegistry. The ConnectedRegistry is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.ConnectedRegistry :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3791,12 +3931,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) + cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) - _request = build_cache_rules_get_request( + _request = build_connected_registries_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, + connected_registry_name=connected_registry_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3831,7 +3971,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.CacheRule, response.json()) + deserialized = _deserialize(_models.ConnectedRegistry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3842,8 +3982,8 @@ async def _create_initial( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_create_parameters: Union[_models.CacheRule, _types.CacheRule, IO[bytes]], + connected_registry_name: str, + connected_registry_create_parameters: Union[_models.ConnectedRegistry, _types.ConnectedRegistry, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3862,15 +4002,15 @@ async def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(cache_rule_create_parameters, (IOBase, bytes)): - _content = cache_rule_create_parameters + if isinstance(connected_registry_create_parameters, (IOBase, bytes)): + _content = connected_registry_create_parameters else: - _content = json.dumps(cache_rule_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(connected_registry_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_cache_rules_create_request( + _request = build_connected_registries_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, + connected_registry_name=connected_registry_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -3922,29 +4062,32 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_create_parameters: _models.CacheRule, + connected_registry_name: str, + connected_registry_create_parameters: _models.ConnectedRegistry, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.CacheRule]: - """Creates a cache rule for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ConnectedRegistry]: + """Creates a connected registry for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. - :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.models.CacheRule + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. + Required. + :type connected_registry_create_parameters: + ~azure.mgmt.containerregistry.models.ConnectedRegistry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3953,29 +4096,32 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_create_parameters: _types.CacheRule, + connected_registry_name: str, + connected_registry_create_parameters: _types.ConnectedRegistry, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.CacheRule]: - """Creates a cache rule for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ConnectedRegistry]: + """Creates a connected registry for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. - :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.types.CacheRule + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. + Required. + :type connected_registry_create_parameters: + ~azure.mgmt.containerregistry.types.ConnectedRegistry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3984,29 +4130,31 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_create_parameters: IO[bytes], + connected_registry_name: str, + connected_registry_create_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.CacheRule]: - """Creates a cache rule for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ConnectedRegistry]: + """Creates a connected registry for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. - :type cache_rule_create_parameters: IO[bytes] + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. + Required. + :type connected_registry_create_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4015,33 +4163,35 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_create_parameters: Union[_models.CacheRule, _types.CacheRule, IO[bytes]], + connected_registry_name: str, + connected_registry_create_parameters: Union[_models.ConnectedRegistry, _types.ConnectedRegistry, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.CacheRule]: - """Creates a cache rule for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ConnectedRegistry]: + """Creates a connected registry for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_create_parameters: The parameters for creating a cache rule. Is either a - CacheRule type or a IO[bytes] type. Required. - :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.models.CacheRule or - ~azure.mgmt.containerregistry.types.CacheRule or IO[bytes] - :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. + Is either a ConnectedRegistry type or a IO[bytes] type. Required. + :type connected_registry_create_parameters: + ~azure.mgmt.containerregistry.models.ConnectedRegistry or + ~azure.mgmt.containerregistry.types.ConnectedRegistry or IO[bytes] + :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) + cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -4049,8 +4199,8 @@ async def begin_create( raw_result = await self._create_initial( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, - cache_rule_create_parameters=cache_rule_create_parameters, + connected_registry_name=connected_registry_name, + connected_registry_create_parameters=connected_registry_create_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -4062,7 +4212,7 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.CacheRule, response.json()) + deserialized = _deserialize(_models.ConnectedRegistry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -4080,13 +4230,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.CacheRule].from_continuation_token( + return AsyncLROPoller[_models.ConnectedRegistry].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.CacheRule]( + return AsyncLROPoller[_models.ConnectedRegistry]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -4094,9 +4244,9 @@ async def _update_initial( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_update_parameters: Union[ - _models.CacheRuleUpdateParameters, _types.CacheRuleUpdateParameters, IO[bytes] + connected_registry_name: str, + connected_registry_update_parameters: Union[ + _models.ConnectedRegistryUpdateParameters, _types.ConnectedRegistryUpdateParameters, IO[bytes] ], **kwargs: Any ) -> AsyncIterator[bytes]: @@ -4116,15 +4266,15 @@ async def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(cache_rule_update_parameters, (IOBase, bytes)): - _content = cache_rule_update_parameters + if isinstance(connected_registry_update_parameters, (IOBase, bytes)): + _content = connected_registry_update_parameters else: - _content = json.dumps(cache_rule_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(connected_registry_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_cache_rules_update_request( + _request = build_connected_registries_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, + connected_registry_name=connected_registry_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -4176,30 +4326,32 @@ async def begin_update( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_update_parameters: _models.CacheRuleUpdateParameters, + connected_registry_name: str, + connected_registry_update_parameters: _models.ConnectedRegistryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.CacheRule]: - """Updates a cache rule for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ConnectedRegistry]: + """Updates a connected registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. - :type cache_rule_update_parameters: - ~azure.mgmt.containerregistry.models.CacheRuleUpdateParameters + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. + Required. + :type connected_registry_update_parameters: + ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4208,30 +4360,32 @@ async def begin_update( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_update_parameters: _types.CacheRuleUpdateParameters, + connected_registry_name: str, + connected_registry_update_parameters: _types.ConnectedRegistryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.CacheRule]: - """Updates a cache rule for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ConnectedRegistry]: + """Updates a connected registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. - :type cache_rule_update_parameters: - ~azure.mgmt.containerregistry.types.CacheRuleUpdateParameters + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. + Required. + :type connected_registry_update_parameters: + ~azure.mgmt.containerregistry.types.ConnectedRegistryUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4240,29 +4394,31 @@ async def begin_update( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_update_parameters: IO[bytes], + connected_registry_name: str, + connected_registry_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.CacheRule]: - """Updates a cache rule for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ConnectedRegistry]: + """Updates a connected registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. - :type cache_rule_update_parameters: IO[bytes] + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. + Required. + :type connected_registry_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4271,45 +4427,46 @@ async def begin_update( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_update_parameters: Union[ - _models.CacheRuleUpdateParameters, _types.CacheRuleUpdateParameters, IO[bytes] + connected_registry_name: str, + connected_registry_update_parameters: Union[ + _models.ConnectedRegistryUpdateParameters, _types.ConnectedRegistryUpdateParameters, IO[bytes] ], **kwargs: Any - ) -> AsyncLROPoller[_models.CacheRule]: - """Updates a cache rule for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ConnectedRegistry]: + """Updates a connected registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_update_parameters: The parameters for updating a cache rule. Is either a - CacheRuleUpdateParameters type or a IO[bytes] type. Required. - :type cache_rule_update_parameters: - ~azure.mgmt.containerregistry.models.CacheRuleUpdateParameters or - ~azure.mgmt.containerregistry.types.CacheRuleUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CacheRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. + Is either a ConnectedRegistryUpdateParameters type or a IO[bytes] type. Required. + :type connected_registry_update_parameters: + ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateParameters or + ~azure.mgmt.containerregistry.types.ConnectedRegistryUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, - cache_rule_update_parameters=cache_rule_update_parameters, + connected_registry_name=connected_registry_name, + connected_registry_update_parameters=connected_registry_update_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -4321,7 +4478,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.CacheRule, response.json()) + deserialized = _deserialize(_models.ConnectedRegistry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -4339,18 +4496,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.CacheRule].from_continuation_token( + return AsyncLROPoller[_models.ConnectedRegistry].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.CacheRule]( + return AsyncLROPoller[_models.ConnectedRegistry]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) async def _delete_initial( - self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4365,10 +4522,10 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_cache_rules_delete_request( + _request = build_connected_registries_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, + connected_registry_name=connected_registry_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -4387,7 +4544,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4413,17 +4570,17 @@ async def _delete_initial( @distributed_trace_async async def begin_delete( - self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a cache rule resource from a container registry. + """Deletes a connected registry from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -4439,7 +4596,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, + connected_registry_name=connected_registry_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -4474,22 +4631,30 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> AsyncItemPaged["_models.CacheRule"]: - """Lists all cache rule resources for the specified container registry. + def list( + self, resource_group_name: str, registry_name: str, *, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.ConnectedRegistry"]: + """Lists all connected registries for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of CacheRule - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.CacheRule] + :keyword 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. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of ConnectedRegistry + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.CacheRule]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ConnectedRegistry]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4502,10 +4667,11 @@ def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> A def prepare_request(next_link=None): if not next_link: - _request = build_cache_rules_list_request( + _request = build_connected_registries_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, + filter=filter, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4545,7 +4711,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.CacheRule], + List[_models.ConnectedRegistry], deserialized.get("value", []), ) if cls: @@ -4573,15 +4739,139 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) + async def _deactivate_initial( + self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) -class CredentialSetsOperations: # pylint: disable=docstring-missing-param + _request = build_connected_registries_deactivate_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + connected_registry_name=connected_registry_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_deactivate( + self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deactivates the connected registry instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._deactivate_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + connected_registry_name=connected_registry_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class PrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`credential_sets` attribute. + :attr:`private_endpoint_connections` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -4595,19 +4885,20 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any - ) -> _models.CredentialSet: - """Gets the properties of the specified credential set resource. + self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Get the specified private endpoint connection associated with the container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :return: CredentialSet. The CredentialSet is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.CredentialSet + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4621,12 +4912,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - _request = build_credential_sets_get_request( + _request = build_private_endpoint_connections_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - credential_set_name=credential_set_name, + private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -4661,19 +4952,21 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.CredentialSet, response.json()) + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_initial( + async def _create_or_update_initial( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_create_parameters: Union[_models.CredentialSet, _types.CredentialSet, IO[bytes]], + private_endpoint_connection_name: str, + private_endpoint_connection: Union[ + _models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes] + ], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -4692,15 +4985,15 @@ async def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(credential_set_create_parameters, (IOBase, bytes)): - _content = credential_set_create_parameters + if isinstance(private_endpoint_connection, (IOBase, bytes)): + _content = private_endpoint_connection else: - _content = json.dumps(credential_set_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(private_endpoint_connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_credential_sets_create_request( + _request = build_private_endpoint_connections_create_or_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - credential_set_name=credential_set_name, + private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -4748,142 +5041,155 @@ async def _create_initial( return deserialized # type: ignore @overload - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_create_parameters: _models.CredentialSet, + private_endpoint_connection_name: str, + private_endpoint_connection: _models.PrivateEndpointConnection, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.CredentialSet]: - """Creates a credential set for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the container + registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_create_parameters: The parameters for creating a credential set. - Required. - :type credential_set_create_parameters: ~azure.mgmt.containerregistry.models.CredentialSet + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The parameters for creating a private endpoint connection. + Required. + :type private_endpoint_connection: + ~azure.mgmt.containerregistry.models.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_create_parameters: _types.CredentialSet, + private_endpoint_connection_name: str, + private_endpoint_connection: _types.PrivateEndpointConnection, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.CredentialSet]: - """Creates a credential set for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the container + registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_create_parameters: The parameters for creating a credential set. + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The parameters for creating a private endpoint connection. Required. - :type credential_set_create_parameters: ~azure.mgmt.containerregistry.types.CredentialSet + :type private_endpoint_connection: + ~azure.mgmt.containerregistry.types.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_create_parameters: IO[bytes], + private_endpoint_connection_name: str, + private_endpoint_connection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.CredentialSet]: - """Creates a credential set for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the container + registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_create_parameters: The parameters for creating a credential set. + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The parameters for creating a private endpoint connection. Required. - :type credential_set_create_parameters: IO[bytes] + :type private_endpoint_connection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_create_parameters: Union[_models.CredentialSet, _types.CredentialSet, IO[bytes]], + private_endpoint_connection_name: str, + private_endpoint_connection: Union[ + _models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes] + ], **kwargs: Any - ) -> AsyncLROPoller[_models.CredentialSet]: - """Creates a credential set for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the container + registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_create_parameters: The parameters for creating a credential set. Is - either a CredentialSet type or a IO[bytes] type. Required. - :type credential_set_create_parameters: ~azure.mgmt.containerregistry.models.CredentialSet or - ~azure.mgmt.containerregistry.types.CredentialSet or IO[bytes] - :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The parameters for creating a private endpoint connection. + Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. + :type private_endpoint_connection: + ~azure.mgmt.containerregistry.models.PrivateEndpointConnection or + ~azure.mgmt.containerregistry.types.PrivateEndpointConnection or IO[bytes] + :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - credential_set_name=credential_set_name, - credential_set_create_parameters=credential_set_create_parameters, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_connection=private_endpoint_connection, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -4895,7 +5201,7 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.CredentialSet, response.json()) + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -4913,25 +5219,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.CredentialSet].from_continuation_token( + return AsyncLROPoller[_models.PrivateEndpointConnection].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.CredentialSet]( + return AsyncLROPoller[_models.PrivateEndpointConnection]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _update_initial( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_update_parameters: Union[ - _models.CredentialSetUpdateParameters, _types.CredentialSetUpdateParameters, IO[bytes] - ], - **kwargs: Any + async def _delete_initial( + self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4941,27 +5240,17 @@ async def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(credential_set_update_parameters, (IOBase, bytes)): - _content = credential_set_update_parameters - else: - _content = json.dumps(credential_set_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_credential_sets_update_request( + _request = build_private_endpoint_connections_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - credential_set_name=credential_set_name, + private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -4978,7 +5267,7 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4991,10 +5280,8 @@ async def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -5004,3655 +5291,88 @@ async def _update_initial( return deserialized # type: ignore - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_update_parameters: _models.CredentialSetUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CredentialSet]: - """Updates a credential set for a container registry with the specified parameters. + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified private endpoint connection associated with the container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_update_parameters: The parameters for updating a credential set. - Required. - :type credential_set_update_parameters: - ~azure.mgmt.containerregistry.models.CredentialSetUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_update_parameters: _types.CredentialSetUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CredentialSet]: - """Updates a credential set for a container registry with the specified parameters. + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, registry_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.PrivateEndpointConnection"]: + """List all private endpoint connections in a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_update_parameters: The parameters for updating a credential set. - Required. - :type credential_set_update_parameters: - ~azure.mgmt.containerregistry.types.CredentialSetUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_update_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CredentialSet]: - """Updates a credential set for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_update_parameters: The parameters for updating a credential set. - Required. - :type credential_set_update_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_update_parameters: Union[ - _models.CredentialSetUpdateParameters, _types.CredentialSetUpdateParameters, IO[bytes] - ], - **kwargs: Any - ) -> AsyncLROPoller[_models.CredentialSet]: - """Updates a credential set for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_update_parameters: The parameters for updating a credential set. Is - either a CredentialSetUpdateParameters type or a IO[bytes] type. Required. - :type credential_set_update_parameters: - ~azure.mgmt.containerregistry.models.CredentialSetUpdateParameters or - ~azure.mgmt.containerregistry.types.CredentialSetUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns CredentialSet. The CredentialSet is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.CredentialSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - credential_set_name=credential_set_name, - credential_set_update_parameters=credential_set_update_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.CredentialSet, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CredentialSet].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CredentialSet]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_credential_sets_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - credential_set_name=credential_set_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a credential set from a container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - credential_set_name=credential_set_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.CredentialSet"]: - """Lists all credential set resources for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: An iterator like instance of CredentialSet + :return: An iterator like instance of PrivateEndpointConnection :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.CredentialSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CredentialSet]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_credential_sets_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CredentialSet], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ConnectedRegistriesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`connected_registries` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> _models.ConnectedRegistry: - """Gets the properties of the connected registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :return: ConnectedRegistry. The ConnectedRegistry is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ConnectedRegistry - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) - - _request = build_connected_registries_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ConnectedRegistry, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_create_parameters: Union[_models.ConnectedRegistry, _types.ConnectedRegistry, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(connected_registry_create_parameters, (IOBase, bytes)): - _content = connected_registry_create_parameters - else: - _content = json.dumps(connected_registry_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connected_registries_create_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_create_parameters: _models.ConnectedRegistry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ConnectedRegistry]: - """Creates a connected registry for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. - Required. - :type connected_registry_create_parameters: - ~azure.mgmt.containerregistry.models.ConnectedRegistry - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_create_parameters: _types.ConnectedRegistry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ConnectedRegistry]: - """Creates a connected registry for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. - Required. - :type connected_registry_create_parameters: - ~azure.mgmt.containerregistry.types.ConnectedRegistry - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ConnectedRegistry]: - """Creates a connected registry for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. - Required. - :type connected_registry_create_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_create_parameters: Union[_models.ConnectedRegistry, _types.ConnectedRegistry, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ConnectedRegistry]: - """Creates a connected registry for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. - Is either a ConnectedRegistry type or a IO[bytes] type. Required. - :type connected_registry_create_parameters: - ~azure.mgmt.containerregistry.models.ConnectedRegistry or - ~azure.mgmt.containerregistry.types.ConnectedRegistry or IO[bytes] - :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - connected_registry_create_parameters=connected_registry_create_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ConnectedRegistry, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ConnectedRegistry].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ConnectedRegistry]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: Union[ - _models.ConnectedRegistryUpdateParameters, _types.ConnectedRegistryUpdateParameters, IO[bytes] - ], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(connected_registry_update_parameters, (IOBase, bytes)): - _content = connected_registry_update_parameters - else: - _content = json.dumps(connected_registry_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connected_registries_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: _models.ConnectedRegistryUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ConnectedRegistry]: - """Updates a connected registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. - Required. - :type connected_registry_update_parameters: - ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: _types.ConnectedRegistryUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ConnectedRegistry]: - """Updates a connected registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. - Required. - :type connected_registry_update_parameters: - ~azure.mgmt.containerregistry.types.ConnectedRegistryUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ConnectedRegistry]: - """Updates a connected registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. - Required. - :type connected_registry_update_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: Union[ - _models.ConnectedRegistryUpdateParameters, _types.ConnectedRegistryUpdateParameters, IO[bytes] - ], - **kwargs: Any - ) -> AsyncLROPoller[_models.ConnectedRegistry]: - """Updates a connected registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. - Is either a ConnectedRegistryUpdateParameters type or a IO[bytes] type. Required. - :type connected_registry_update_parameters: - ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateParameters or - ~azure.mgmt.containerregistry.types.ConnectedRegistryUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - connected_registry_update_parameters=connected_registry_update_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ConnectedRegistry, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ConnectedRegistry].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ConnectedRegistry]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_connected_registries_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a connected registry from a container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, registry_name: str, *, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ConnectedRegistry"]: - """Lists all connected registries for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :keyword 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. Default - value is None. - :paramtype filter: str - :return: An iterator like instance of ConnectedRegistry - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.ConnectedRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ConnectedRegistry]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connected_registries_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ConnectedRegistry], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _deactivate_initial( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_connected_registries_deactivate_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_deactivate( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deactivates the connected registry instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._deactivate_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "connected_registry_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def resync( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> _models.ConnectedRegistry: - """Resync the connected registry instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :return: ConnectedRegistry. The ConnectedRegistry is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ConnectedRegistry - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) - - _request = build_connected_registries_resync_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ConnectedRegistry, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class PrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Get the specified private endpoint connection associated with the container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_private_endpoint_connections_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: Union[ - _models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes] - ], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(private_endpoint_connection, (IOBase, bytes)): - _content = private_endpoint_connection - else: - _content = json.dumps(private_endpoint_connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_private_endpoint_connections_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the container - registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: The parameters for creating a private endpoint connection. - Required. - :type private_endpoint_connection: - ~azure.mgmt.containerregistry.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: _types.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the container - registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: The parameters for creating a private endpoint connection. - Required. - :type private_endpoint_connection: - ~azure.mgmt.containerregistry.types.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the container - registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: The parameters for creating a private endpoint connection. - Required. - :type private_endpoint_connection: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: Union[ - _models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes] - ], - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the container - registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: The parameters for creating a private endpoint connection. - Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type private_endpoint_connection: - ~azure.mgmt.containerregistry.models.PrivateEndpointConnection or - ~azure.mgmt.containerregistry.types.PrivateEndpointConnection or IO[bytes] - :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - private_endpoint_connection_name=private_endpoint_connection_name, - private_endpoint_connection=private_endpoint_connection, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PrivateEndpointConnection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PrivateEndpointConnection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_private_endpoint_connections_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified private endpoint connection associated with the container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - private_endpoint_connection_name=private_endpoint_connection_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.PrivateEndpointConnection"]: - """List all private endpoint connections in a container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: An iterator like instance of PrivateEndpointConnection - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_private_endpoint_connections_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.PrivateEndpointConnection], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ReplicationsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`replications` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any - ) -> _models.Replication: - """Gets the properties of the specified replication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :return: Replication. The Replication is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Replication - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Replication] = kwargs.pop("cls", None) - - _request = build_replications_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - replication_name=replication_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Replication, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - registry_name: str, - replication_name: str, - replication: Union[_models.Replication, _types.Replication, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(replication, (IOBase, bytes)): - _content = replication - else: - _content = json.dumps(replication, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_replications_create_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - replication_name=replication_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - replication_name: str, - replication: _models.Replication, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Replication]: - """Creates a replication for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication: The parameters for creating a replication. Required. - :type replication: ~azure.mgmt.containerregistry.models.Replication - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - replication_name: str, - replication: _types.Replication, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Replication]: - """Creates a replication for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication: The parameters for creating a replication. Required. - :type replication: ~azure.mgmt.containerregistry.types.Replication - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - replication_name: str, - replication: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Replication]: - """Creates a replication for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication: The parameters for creating a replication. Required. - :type replication: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - replication_name: str, - replication: Union[_models.Replication, _types.Replication, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Replication]: - """Creates a replication for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication: The parameters for creating a replication. Is either a Replication type or - a IO[bytes] type. Required. - :type replication: ~azure.mgmt.containerregistry.models.Replication or - ~azure.mgmt.containerregistry.types.Replication or IO[bytes] - :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Replication] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - replication_name=replication_name, - replication=replication, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Replication, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Replication].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Replication]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - registry_name: str, - replication_name: str, - replication_update_parameters: Union[ - _models.ReplicationUpdateParameters, _types.ReplicationUpdateParameters, IO[bytes] - ], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(replication_update_parameters, (IOBase, bytes)): - _content = replication_update_parameters - else: - _content = json.dumps(replication_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_replications_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - replication_name=replication_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - replication_name: str, - replication_update_parameters: _models.ReplicationUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Replication]: - """Updates a replication for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication_update_parameters: The parameters for updating a replication. Required. - :type replication_update_parameters: - ~azure.mgmt.containerregistry.models.ReplicationUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - replication_name: str, - replication_update_parameters: _types.ReplicationUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Replication]: - """Updates a replication for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication_update_parameters: The parameters for updating a replication. Required. - :type replication_update_parameters: - ~azure.mgmt.containerregistry.types.ReplicationUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - replication_name: str, - replication_update_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Replication]: - """Updates a replication for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication_update_parameters: The parameters for updating a replication. Required. - :type replication_update_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - replication_name: str, - replication_update_parameters: Union[ - _models.ReplicationUpdateParameters, _types.ReplicationUpdateParameters, IO[bytes] - ], - **kwargs: Any - ) -> AsyncLROPoller[_models.Replication]: - """Updates a replication for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication_update_parameters: The parameters for updating a replication. Is either a - ReplicationUpdateParameters type or a IO[bytes] type. Required. - :type replication_update_parameters: - ~azure.mgmt.containerregistry.models.ReplicationUpdateParameters or - ~azure.mgmt.containerregistry.types.ReplicationUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Replication] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - replication_name=replication_name, - replication_update_parameters=replication_update_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Replication, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Replication].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Replication]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_replications_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - replication_name=replication_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a replication from a container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - replication_name=replication_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Replication"]: - """Lists all the replications for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: An iterator like instance of Replication - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.Replication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Replication]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_replications_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Replication], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ScopeMapsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`scope_maps` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any - ) -> _models.ScopeMap: - """Gets the properties of the specified scope map. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :return: ScopeMap. The ScopeMap is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ScopeMap - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) - - _request = build_scope_maps_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - scope_map_name=scope_map_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ScopeMap, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_create_parameters: Union[_models.ScopeMap, _types.ScopeMap, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(scope_map_create_parameters, (IOBase, bytes)): - _content = scope_map_create_parameters - else: - _content = json.dumps(scope_map_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_scope_maps_create_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - scope_map_name=scope_map_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_create_parameters: _models.ScopeMap, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ScopeMap]: - """Creates a scope map for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_create_parameters: The parameters for creating a scope map. Required. - :type scope_map_create_parameters: ~azure.mgmt.containerregistry.models.ScopeMap - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_create_parameters: _types.ScopeMap, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ScopeMap]: - """Creates a scope map for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_create_parameters: The parameters for creating a scope map. Required. - :type scope_map_create_parameters: ~azure.mgmt.containerregistry.types.ScopeMap - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ScopeMap]: - """Creates a scope map for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_create_parameters: The parameters for creating a scope map. Required. - :type scope_map_create_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_create_parameters: Union[_models.ScopeMap, _types.ScopeMap, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ScopeMap]: - """Creates a scope map for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_create_parameters: The parameters for creating a scope map. Is either a - ScopeMap type or a IO[bytes] type. Required. - :type scope_map_create_parameters: ~azure.mgmt.containerregistry.models.ScopeMap or - ~azure.mgmt.containerregistry.types.ScopeMap or IO[bytes] - :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - scope_map_name=scope_map_name, - scope_map_create_parameters=scope_map_create_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ScopeMap, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ScopeMap].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ScopeMap]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_update_parameters: Union[ - _models.ScopeMapUpdateParameters, _types.ScopeMapUpdateParameters, IO[bytes] - ], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(scope_map_update_parameters, (IOBase, bytes)): - _content = scope_map_update_parameters - else: - _content = json.dumps(scope_map_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_scope_maps_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - scope_map_name=scope_map_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_update_parameters: _models.ScopeMapUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ScopeMap]: - """Updates a scope map with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_update_parameters: The parameters for updating a scope map. Required. - :type scope_map_update_parameters: - ~azure.mgmt.containerregistry.models.ScopeMapUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_update_parameters: _types.ScopeMapUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ScopeMap]: - """Updates a scope map with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_update_parameters: The parameters for updating a scope map. Required. - :type scope_map_update_parameters: ~azure.mgmt.containerregistry.types.ScopeMapUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_update_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ScopeMap]: - """Updates a scope map with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_update_parameters: The parameters for updating a scope map. Required. - :type scope_map_update_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_update_parameters: Union[ - _models.ScopeMapUpdateParameters, _types.ScopeMapUpdateParameters, IO[bytes] - ], - **kwargs: Any - ) -> AsyncLROPoller[_models.ScopeMap]: - """Updates a scope map with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_update_parameters: The parameters for updating a scope map. Is either a - ScopeMapUpdateParameters type or a IO[bytes] type. Required. - :type scope_map_update_parameters: - ~azure.mgmt.containerregistry.models.ScopeMapUpdateParameters or - ~azure.mgmt.containerregistry.types.ScopeMapUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - scope_map_name=scope_map_name, - scope_map_update_parameters=scope_map_update_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ScopeMap, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ScopeMap].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ScopeMap]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_scope_maps_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - scope_map_name=scope_map_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a scope map from a container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - scope_map_name=scope_map_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> AsyncItemPaged["_models.ScopeMap"]: - """Lists all the scope maps for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: An iterator like instance of ScopeMap - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.ScopeMap] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ScopeMap]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8665,7 +5385,7 @@ def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> A def prepare_request(next_link=None): if not next_link: - _request = build_scope_maps_list_request( + _request = build_private_endpoint_connections_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, @@ -8708,7 +5428,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ScopeMap], + List[_models.PrivateEndpointConnection], deserialized.get("value", []), ) if cls: @@ -8737,14 +5457,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class TokensOperations: # pylint: disable=docstring-missing-param +class ReplicationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`tokens` attribute. + :attr:`replications` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -8757,18 +5477,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any) -> _models.Token: - """Gets the properties of the specified token. + async def get( + self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any + ) -> _models.Replication: + """Gets the properties of the specified replication. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :return: Token. The Token is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Token + :param replication_name: The name of the replication. Required. + :type replication_name: str + :return: Replication. The Replication is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.Replication :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8782,12 +5504,12 @@ async def get(self, resource_group_name: str, registry_name: str, token_name: st _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Token] = kwargs.pop("cls", None) + cls: ClsType[_models.Replication] = kwargs.pop("cls", None) - _request = build_tokens_get_request( + _request = build_replications_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, + replication_name=replication_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8822,7 +5544,7 @@ async def get(self, resource_group_name: str, registry_name: str, token_name: st if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Token, response.json()) + deserialized = _deserialize(_models.Replication, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8833,8 +5555,8 @@ async def _create_initial( self, resource_group_name: str, registry_name: str, - token_name: str, - token_create_parameters: Union[_models.Token, _types.Token, IO[bytes]], + replication_name: str, + replication: Union[_models.Replication, _types.Replication, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -8853,15 +5575,15 @@ async def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(token_create_parameters, (IOBase, bytes)): - _content = token_create_parameters + if isinstance(replication, (IOBase, bytes)): + _content = replication else: - _content = json.dumps(token_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(replication, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_tokens_create_request( + _request = build_replications_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, + replication_name=replication_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -8913,29 +5635,29 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - token_name: str, - token_create_parameters: _models.Token, + replication_name: str, + replication: _models.Replication, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Token]: - """Creates a token for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.Replication]: + """Creates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_create_parameters: The parameters for creating a token. Required. - :type token_create_parameters: ~azure.mgmt.containerregistry.models.Token + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication: The parameters for creating a replication. Required. + :type replication: ~azure.mgmt.containerregistry.models.Replication :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8944,29 +5666,29 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - token_name: str, - token_create_parameters: _types.Token, + replication_name: str, + replication: _types.Replication, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Token]: - """Creates a token for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.Replication]: + """Creates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_create_parameters: The parameters for creating a token. Required. - :type token_create_parameters: ~azure.mgmt.containerregistry.types.Token + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication: The parameters for creating a replication. Required. + :type replication: ~azure.mgmt.containerregistry.types.Replication :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8975,29 +5697,29 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - token_name: str, - token_create_parameters: IO[bytes], + replication_name: str, + replication: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Token]: - """Creates a token for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.Replication]: + """Creates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_create_parameters: The parameters for creating a token. Required. - :type token_create_parameters: IO[bytes] + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication: The parameters for creating a replication. Required. + :type replication: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9006,33 +5728,33 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - token_name: str, - token_create_parameters: Union[_models.Token, _types.Token, IO[bytes]], + replication_name: str, + replication: Union[_models.Replication, _types.Replication, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Token]: - """Creates a token for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.Replication]: + """Creates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_create_parameters: The parameters for creating a token. Is either a Token type or + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication: The parameters for creating a replication. Is either a Replication type or a IO[bytes] type. Required. - :type token_create_parameters: ~azure.mgmt.containerregistry.models.Token or - ~azure.mgmt.containerregistry.types.Token or IO[bytes] - :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + :type replication: ~azure.mgmt.containerregistry.models.Replication or + ~azure.mgmt.containerregistry.types.Replication or IO[bytes] + :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Token] = kwargs.pop("cls", None) + cls: ClsType[_models.Replication] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -9040,8 +5762,8 @@ async def begin_create( raw_result = await self._create_initial( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, - token_create_parameters=token_create_parameters, + replication_name=replication_name, + replication=replication, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -9053,7 +5775,7 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Token, response.json()) + deserialized = _deserialize(_models.Replication, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -9071,13 +5793,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Token].from_continuation_token( + return AsyncLROPoller[_models.Replication].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Token]( + return AsyncLROPoller[_models.Replication]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -9085,8 +5807,10 @@ async def _update_initial( self, resource_group_name: str, registry_name: str, - token_name: str, - token_update_parameters: Union[_models.TokenUpdateParameters, _types.TokenUpdateParameters, IO[bytes]], + replication_name: str, + replication_update_parameters: Union[ + _models.ReplicationUpdateParameters, _types.ReplicationUpdateParameters, IO[bytes] + ], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -9105,15 +5829,15 @@ async def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(token_update_parameters, (IOBase, bytes)): - _content = token_update_parameters + if isinstance(replication_update_parameters, (IOBase, bytes)): + _content = replication_update_parameters else: - _content = json.dumps(token_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(replication_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_tokens_update_request( + _request = build_replications_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, + replication_name=replication_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9165,29 +5889,30 @@ async def begin_update( self, resource_group_name: str, registry_name: str, - token_name: str, - token_update_parameters: _models.TokenUpdateParameters, + replication_name: str, + replication_update_parameters: _models.ReplicationUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Token]: - """Updates a token with the specified parameters. + ) -> AsyncLROPoller[_models.Replication]: + """Updates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_update_parameters: The parameters for updating a token. Required. - :type token_update_parameters: ~azure.mgmt.containerregistry.models.TokenUpdateParameters + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication_update_parameters: The parameters for updating a replication. Required. + :type replication_update_parameters: + ~azure.mgmt.containerregistry.models.ReplicationUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9196,29 +5921,30 @@ async def begin_update( self, resource_group_name: str, registry_name: str, - token_name: str, - token_update_parameters: _types.TokenUpdateParameters, + replication_name: str, + replication_update_parameters: _types.ReplicationUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Token]: - """Updates a token with the specified parameters. + ) -> AsyncLROPoller[_models.Replication]: + """Updates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_update_parameters: The parameters for updating a token. Required. - :type token_update_parameters: ~azure.mgmt.containerregistry.types.TokenUpdateParameters + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication_update_parameters: The parameters for updating a replication. Required. + :type replication_update_parameters: + ~azure.mgmt.containerregistry.types.ReplicationUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9227,29 +5953,29 @@ async def begin_update( self, resource_group_name: str, registry_name: str, - token_name: str, - token_update_parameters: IO[bytes], + replication_name: str, + replication_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Token]: - """Updates a token with the specified parameters. + ) -> AsyncLROPoller[_models.Replication]: + """Updates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_update_parameters: The parameters for updating a token. Required. - :type token_update_parameters: IO[bytes] + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication_update_parameters: The parameters for updating a replication. Required. + :type replication_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9258,33 +5984,36 @@ async def begin_update( self, resource_group_name: str, registry_name: str, - token_name: str, - token_update_parameters: Union[_models.TokenUpdateParameters, _types.TokenUpdateParameters, IO[bytes]], + replication_name: str, + replication_update_parameters: Union[ + _models.ReplicationUpdateParameters, _types.ReplicationUpdateParameters, IO[bytes] + ], **kwargs: Any - ) -> AsyncLROPoller[_models.Token]: - """Updates a token with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_update_parameters: The parameters for updating a token. Is either a - TokenUpdateParameters type or a IO[bytes] type. Required. - :type token_update_parameters: ~azure.mgmt.containerregistry.models.TokenUpdateParameters or - ~azure.mgmt.containerregistry.types.TokenUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + ) -> AsyncLROPoller[_models.Replication]: + """Updates a replication for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication_update_parameters: The parameters for updating a replication. Is either a + ReplicationUpdateParameters type or a IO[bytes] type. Required. + :type replication_update_parameters: + ~azure.mgmt.containerregistry.models.ReplicationUpdateParameters or + ~azure.mgmt.containerregistry.types.ReplicationUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns Replication. The Replication is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Token] = kwargs.pop("cls", None) + cls: ClsType[_models.Replication] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -9292,8 +6021,8 @@ async def begin_update( raw_result = await self._update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, - token_update_parameters=token_update_parameters, + replication_name=replication_name, + replication_update_parameters=replication_update_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -9305,7 +6034,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Token, response.json()) + deserialized = _deserialize(_models.Replication, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -9323,18 +6052,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Token].from_continuation_token( + return AsyncLROPoller[_models.Replication].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Token]( + return AsyncLROPoller[_models.Replication]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) async def _delete_initial( - self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9349,10 +6078,10 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_tokens_delete_request( + _request = build_replications_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, + replication_name=replication_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9397,17 +6126,17 @@ async def _delete_initial( @distributed_trace_async async def begin_delete( - self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a token from a container registry. + """Deletes a replication from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str + :param replication_name: The name of the replication. Required. + :type replication_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -9423,7 +6152,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, + replication_name=replication_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -9458,22 +6187,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Token"]: - """Lists all the tokens for the specified container registry. + def list( + self, resource_group_name: str, registry_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Replication"]: + """Lists all the replications for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of Token - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.Token] + :return: An iterator like instance of Replication + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Token]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Replication]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9486,7 +6218,7 @@ def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> A def prepare_request(next_link=None): if not next_link: - _request = build_tokens_list_request( + _request = build_replications_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, @@ -9529,7 +6261,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Token], + List[_models.Replication], deserialized.get("value", []), ) if cls: @@ -9558,14 +6290,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ExportPipelinesOperations: # pylint: disable=docstring-missing-param +class ScopeMapsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`export_pipelines` attribute. + :attr:`scope_maps` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -9578,34 +6310,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "export_pipeline_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def get( - self, resource_group_name: str, registry_name: str, export_pipeline_name: str, **kwargs: Any - ) -> _models.ExportPipeline: - """Gets the properties of the export pipeline. + self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any + ) -> _models.ScopeMap: + """Gets the properties of the specified scope map. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :return: ExportPipeline. The ExportPipeline is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ExportPipeline + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :return: ScopeMap. The ScopeMap is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.ScopeMap :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9619,12 +6337,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ExportPipeline] = kwargs.pop("cls", None) + cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) - _request = build_export_pipelines_get_request( + _request = build_scope_maps_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - export_pipeline_name=export_pipeline_name, + scope_map_name=scope_map_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9659,34 +6377,19 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ExportPipeline, response.json()) + deserialized = _deserialize(_models.ScopeMap, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "export_pipeline_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def _create_initial( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: Union[_models.ExportPipeline, _types.ExportPipeline, IO[bytes]], + scope_map_name: str, + scope_map_create_parameters: Union[_models.ScopeMap, _types.ScopeMap, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -9705,15 +6408,15 @@ async def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(export_pipeline_create_parameters, (IOBase, bytes)): - _content = export_pipeline_create_parameters + if isinstance(scope_map_create_parameters, (IOBase, bytes)): + _content = scope_map_create_parameters else: - _content = json.dumps(export_pipeline_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(scope_map_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_export_pipelines_create_request( + _request = build_scope_maps_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - export_pipeline_name=export_pipeline_name, + scope_map_name=scope_map_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9765,30 +6468,29 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: _models.ExportPipeline, + scope_map_name: str, + scope_map_create_parameters: _models.ScopeMap, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ExportPipeline]: - """Creates an export pipeline for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ScopeMap]: + """Creates a scope map for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :param export_pipeline_create_parameters: The parameters for creating an export pipeline. - Required. - :type export_pipeline_create_parameters: ~azure.mgmt.containerregistry.models.ExportPipeline + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_create_parameters: The parameters for creating a scope map. Required. + :type scope_map_create_parameters: ~azure.mgmt.containerregistry.models.ScopeMap :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ExportPipeline. The ExportPipeline is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ExportPipeline] + :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9797,30 +6499,29 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: _types.ExportPipeline, + scope_map_name: str, + scope_map_create_parameters: _types.ScopeMap, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ExportPipeline]: - """Creates an export pipeline for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ScopeMap]: + """Creates a scope map for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :param export_pipeline_create_parameters: The parameters for creating an export pipeline. - Required. - :type export_pipeline_create_parameters: ~azure.mgmt.containerregistry.types.ExportPipeline + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_create_parameters: The parameters for creating a scope map. Required. + :type scope_map_create_parameters: ~azure.mgmt.containerregistry.types.ScopeMap :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ExportPipeline. The ExportPipeline is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ExportPipeline] + :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9829,245 +6530,74 @@ async def begin_create( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: IO[bytes], + scope_map_name: str, + scope_map_create_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ExportPipeline]: - """Creates an export pipeline for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ScopeMap]: + """Creates a scope map for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :param export_pipeline_create_parameters: The parameters for creating an export pipeline. - Required. - :type export_pipeline_create_parameters: IO[bytes] + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_create_parameters: The parameters for creating a scope map. Required. + :type scope_map_create_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ExportPipeline. The ExportPipeline is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ExportPipeline] + :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "export_pipeline_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def begin_create( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: Union[_models.ExportPipeline, _types.ExportPipeline, IO[bytes]], + scope_map_name: str, + scope_map_create_parameters: Union[_models.ScopeMap, _types.ScopeMap, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.ExportPipeline]: - """Creates an export pipeline for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :param export_pipeline_create_parameters: The parameters for creating an export pipeline. Is - either a ExportPipeline type or a IO[bytes] type. Required. - :type export_pipeline_create_parameters: ~azure.mgmt.containerregistry.models.ExportPipeline or - ~azure.mgmt.containerregistry.types.ExportPipeline or IO[bytes] - :return: An instance of AsyncLROPoller that returns ExportPipeline. The ExportPipeline is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ExportPipeline] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExportPipeline] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - export_pipeline_name=export_pipeline_name, - export_pipeline_create_parameters=export_pipeline_create_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ExportPipeline, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ExportPipeline].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ExportPipeline]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "export_pipeline_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def _delete_initial( - self, resource_group_name: str, registry_name: str, export_pipeline_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_export_pipelines_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - export_pipeline_name=export_pipeline_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "export_pipeline_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def begin_delete( - self, resource_group_name: str, registry_name: str, export_pipeline_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an export pipeline from a container registry. + ) -> AsyncLROPoller[_models.ScopeMap]: + """Creates a scope map for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_create_parameters: The parameters for creating a scope map. Is either a + ScopeMap type or a IO[bytes] type. Required. + :type scope_map_create_parameters: ~azure.mgmt.containerregistry.models.ScopeMap or + ~azure.mgmt.containerregistry.types.ScopeMap or IO[bytes] + :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._create_initial( resource_group_name=resource_group_name, registry_name=registry_name, - export_pipeline_name=export_pipeline_name, + scope_map_name=scope_map_name, + scope_map_create_parameters=scope_map_create_parameters, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10076,9 +6606,12 @@ async def begin_delete( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ScopeMap, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -10093,254 +6626,24 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.ScopeMap].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": ["api_version", "subscription_id", "resource_group_name", "registry_name", "accept"] - }, - api_versions_list=["2026-10-15-preview"], - ) - def list( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ExportPipeline"]: - """Lists all export pipelines for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: An iterator like instance of ExportPipeline - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.ExportPipeline] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ExportPipeline]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_export_pipelines_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ExportPipeline], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ImportPipelinesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`import_pipelines` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "import_pipeline_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def get( - self, resource_group_name: str, registry_name: str, import_pipeline_name: str, **kwargs: Any - ) -> _models.ImportPipeline: - """Gets the properties of the import pipeline. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str - :return: ImportPipeline. The ImportPipeline is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ImportPipeline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ImportPipeline] = kwargs.pop("cls", None) - - _request = build_import_pipelines_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - import_pipeline_name=import_pipeline_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + return AsyncLROPoller[_models.ScopeMap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ImportPipeline, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "import_pipeline_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def _create_initial( + async def _update_initial( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: Union[_models.ImportPipeline, _types.ImportPipeline, IO[bytes]], + scope_map_name: str, + scope_map_update_parameters: Union[ + _models.ScopeMapUpdateParameters, _types.ScopeMapUpdateParameters, IO[bytes] + ], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -10359,15 +6662,15 @@ async def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(import_pipeline_create_parameters, (IOBase, bytes)): - _content = import_pipeline_create_parameters + if isinstance(scope_map_update_parameters, (IOBase, bytes)): + _content = scope_map_update_parameters else: - _content = json.dumps(import_pipeline_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(scope_map_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_import_pipelines_create_request( + _request = build_scope_maps_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - import_pipeline_name=import_pipeline_name, + scope_map_name=scope_map_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -10415,157 +6718,143 @@ async def _create_initial( return deserialized # type: ignore @overload - async def begin_create( + async def begin_update( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: _models.ImportPipeline, + scope_map_name: str, + scope_map_update_parameters: _models.ScopeMapUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ImportPipeline]: - """Creates an import pipeline for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ScopeMap]: + """Updates a scope map with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str - :param import_pipeline_create_parameters: The parameters for creating an import pipeline. - Required. - :type import_pipeline_create_parameters: ~azure.mgmt.containerregistry.models.ImportPipeline + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_update_parameters: The parameters for updating a scope map. Required. + :type scope_map_update_parameters: + ~azure.mgmt.containerregistry.models.ScopeMapUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ImportPipeline. The ImportPipeline is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ImportPipeline] + :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create( + async def begin_update( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: _types.ImportPipeline, + scope_map_name: str, + scope_map_update_parameters: _types.ScopeMapUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ImportPipeline]: - """Creates an import pipeline for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ScopeMap]: + """Updates a scope map with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str - :param import_pipeline_create_parameters: The parameters for creating an import pipeline. - Required. - :type import_pipeline_create_parameters: ~azure.mgmt.containerregistry.types.ImportPipeline + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_update_parameters: The parameters for updating a scope map. Required. + :type scope_map_update_parameters: ~azure.mgmt.containerregistry.types.ScopeMapUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ImportPipeline. The ImportPipeline is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ImportPipeline] + :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create( + async def begin_update( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: IO[bytes], + scope_map_name: str, + scope_map_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ImportPipeline]: - """Creates an import pipeline for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ScopeMap]: + """Updates a scope map with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str - :param import_pipeline_create_parameters: The parameters for creating an import pipeline. - Required. - :type import_pipeline_create_parameters: IO[bytes] + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_update_parameters: The parameters for updating a scope map. Required. + :type scope_map_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ImportPipeline. The ImportPipeline is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ImportPipeline] + :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "import_pipeline_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def begin_create( + async def begin_update( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: Union[_models.ImportPipeline, _types.ImportPipeline, IO[bytes]], + scope_map_name: str, + scope_map_update_parameters: Union[ + _models.ScopeMapUpdateParameters, _types.ScopeMapUpdateParameters, IO[bytes] + ], **kwargs: Any - ) -> AsyncLROPoller[_models.ImportPipeline]: - """Creates an import pipeline for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.ScopeMap]: + """Updates a scope map with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str - :param import_pipeline_create_parameters: The parameters for creating an import pipeline. Is - either a ImportPipeline type or a IO[bytes] type. Required. - :type import_pipeline_create_parameters: ~azure.mgmt.containerregistry.models.ImportPipeline or - ~azure.mgmt.containerregistry.types.ImportPipeline or IO[bytes] - :return: An instance of AsyncLROPoller that returns ImportPipeline. The ImportPipeline is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ImportPipeline] + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_update_parameters: The parameters for updating a scope map. Is either a + ScopeMapUpdateParameters type or a IO[bytes] type. Required. + :type scope_map_update_parameters: + ~azure.mgmt.containerregistry.models.ScopeMapUpdateParameters or + ~azure.mgmt.containerregistry.types.ScopeMapUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImportPipeline] = kwargs.pop("cls", None) + cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_initial( + raw_result = await self._update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - import_pipeline_name=import_pipeline_name, - import_pipeline_create_parameters=import_pipeline_create_parameters, + scope_map_name=scope_map_name, + scope_map_update_parameters=scope_map_update_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -10577,7 +6866,7 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ImportPipeline, response.json()) + deserialized = _deserialize(_models.ScopeMap, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -10595,31 +6884,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.ImportPipeline].from_continuation_token( + return AsyncLROPoller[_models.ScopeMap].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.ImportPipeline]( + return AsyncLROPoller[_models.ScopeMap]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "import_pipeline_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def _delete_initial( - self, resource_group_name: str, registry_name: str, import_pipeline_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10634,10 +6910,10 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_import_pipelines_delete_request( + _request = build_scope_maps_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - import_pipeline_name=import_pipeline_name, + scope_map_name=scope_map_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10681,31 +6957,18 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "import_pipeline_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def begin_delete( - self, resource_group_name: str, registry_name: str, import_pipeline_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes an import pipeline from a container registry. + """Deletes a scope map from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -10721,7 +6984,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - import_pipeline_name=import_pipeline_name, + scope_map_name=scope_map_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10756,32 +7019,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": ["api_version", "subscription_id", "resource_group_name", "registry_name", "accept"] - }, - api_versions_list=["2026-10-15-preview"], - ) - def list( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ImportPipeline"]: - """Lists all import pipelines for the specified container registry. + def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> AsyncItemPaged["_models.ScopeMap"]: + """Lists all the scope maps for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of ImportPipeline - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.ImportPipeline] + :return: An iterator like instance of ScopeMap + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ImportPipeline]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ScopeMap]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10794,7 +7047,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_import_pipelines_list_request( + _request = build_scope_maps_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, @@ -10837,7 +7090,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ImportPipeline], + List[_models.ScopeMap], deserialized.get("value", []), ) if cls: @@ -10866,135 +7119,356 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class PipelineRunsOperations: # pylint: disable=docstring-missing-param +class TokensOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s - :attr:`pipeline_runs` attribute. - """ + Instead, you should access the following operations through + :class:`~azure.mgmt.containerregistry.aio.ContainerRegistryManagementClient`'s + :attr:`tokens` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerRegistryManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any) -> _models.Token: + """Gets the properties of the specified token. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param token_name: The name of the token. Required. + :type token_name: str + :return: Token. The Token is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.Token + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Token] = kwargs.pop("cls", None) + + _request = build_tokens_get_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + token_name=token_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Token, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + registry_name: str, + token_name: str, + token_create_parameters: Union[_models.Token, _types.Token, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(token_create_parameters, (IOBase, bytes)): + _content = token_create_parameters + else: + _content = json.dumps(token_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_tokens_create_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + token_name=token_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + registry_name: str, + token_name: str, + token_create_parameters: _models.Token, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Token]: + """Creates a token for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param token_name: The name of the token. Required. + :type token_name: str + :param token_create_parameters: The parameters for creating a token. Required. + :type token_create_parameters: ~azure.mgmt.containerregistry.models.Token + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + registry_name: str, + token_name: str, + token_create_parameters: _types.Token, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Token]: + """Creates a token for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param token_name: The name of the token. Required. + :type token_name: str + :param token_create_parameters: The parameters for creating a token. Required. + :type token_create_parameters: ~azure.mgmt.containerregistry.types.Token + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + registry_name: str, + token_name: str, + token_create_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Token]: + """Creates a token for a container registry with the specified parameters. - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param token_name: The name of the token. Required. + :type token_name: str + :param token_create_parameters: The parameters for creating a token. Required. + :type token_create_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "pipeline_run_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def get( - self, resource_group_name: str, registry_name: str, pipeline_run_name: str, **kwargs: Any - ) -> _models.PipelineRun: - """Gets the detailed information for a given pipeline run. + async def begin_create( + self, + resource_group_name: str, + registry_name: str, + token_name: str, + token_create_parameters: Union[_models.Token, _types.Token, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Token]: + """Creates a token for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str - :return: PipelineRun. The PipelineRun is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.PipelineRun + :param token_name: The name of the token. Required. + :type token_name: str + :param token_create_parameters: The parameters for creating a token. Is either a Token type or + a IO[bytes] type. Required. + :type token_create_parameters: ~azure.mgmt.containerregistry.models.Token or + ~azure.mgmt.containerregistry.types.Token or IO[bytes] + :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.PipelineRun] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Token] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + token_name=token_name, + token_create_parameters=token_create_parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Token, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_pipeline_runs_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - pipeline_run_name=pipeline_run_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.PipelineRun, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Token].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Token]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "pipeline_run_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def _create_initial( + async def _update_initial( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: Union[_models.PipelineRun, _types.PipelineRun, IO[bytes]], + token_name: str, + token_update_parameters: Union[_models.TokenUpdateParameters, _types.TokenUpdateParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -11013,15 +7487,15 @@ async def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(pipeline_run_create_parameters, (IOBase, bytes)): - _content = pipeline_run_create_parameters + if isinstance(token_update_parameters, (IOBase, bytes)): + _content = token_update_parameters else: - _content = json.dumps(pipeline_run_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(token_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_pipeline_runs_create_request( + _request = build_tokens_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - pipeline_run_name=pipeline_run_name, + token_name=token_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -11069,154 +7543,139 @@ async def _create_initial( return deserialized # type: ignore @overload - async def begin_create( + async def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: _models.PipelineRun, + token_name: str, + token_update_parameters: _models.TokenUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PipelineRun]: - """Creates a pipeline run for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.Token]: + """Updates a token with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str - :param pipeline_run_create_parameters: The parameters for creating a pipeline run. Required. - :type pipeline_run_create_parameters: ~azure.mgmt.containerregistry.models.PipelineRun + :param token_name: The name of the token. Required. + :type token_name: str + :param token_update_parameters: The parameters for updating a token. Required. + :type token_update_parameters: ~azure.mgmt.containerregistry.models.TokenUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns PipelineRun. The PipelineRun is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PipelineRun] + :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create( + async def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: _types.PipelineRun, + token_name: str, + token_update_parameters: _types.TokenUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PipelineRun]: - """Creates a pipeline run for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.Token]: + """Updates a token with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str - :param pipeline_run_create_parameters: The parameters for creating a pipeline run. Required. - :type pipeline_run_create_parameters: ~azure.mgmt.containerregistry.types.PipelineRun + :param token_name: The name of the token. Required. + :type token_name: str + :param token_update_parameters: The parameters for updating a token. Required. + :type token_update_parameters: ~azure.mgmt.containerregistry.types.TokenUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns PipelineRun. The PipelineRun is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PipelineRun] + :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create( + async def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: IO[bytes], + token_name: str, + token_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PipelineRun]: - """Creates a pipeline run for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.Token]: + """Updates a token with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str - :param pipeline_run_create_parameters: The parameters for creating a pipeline run. Required. - :type pipeline_run_create_parameters: IO[bytes] + :param token_name: The name of the token. Required. + :type token_name: str + :param token_update_parameters: The parameters for updating a token. Required. + :type token_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns PipelineRun. The PipelineRun is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PipelineRun] + :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "pipeline_run_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - async def begin_create( + async def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: Union[_models.PipelineRun, _types.PipelineRun, IO[bytes]], + token_name: str, + token_update_parameters: Union[_models.TokenUpdateParameters, _types.TokenUpdateParameters, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.PipelineRun]: - """Creates a pipeline run for a container registry with the specified parameters. + ) -> AsyncLROPoller[_models.Token]: + """Updates a token with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str - :param pipeline_run_create_parameters: The parameters for creating a pipeline run. Is either a - PipelineRun type or a IO[bytes] type. Required. - :type pipeline_run_create_parameters: ~azure.mgmt.containerregistry.models.PipelineRun or - ~azure.mgmt.containerregistry.types.PipelineRun or IO[bytes] - :return: An instance of AsyncLROPoller that returns PipelineRun. The PipelineRun is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.PipelineRun] + :param token_name: The name of the token. Required. + :type token_name: str + :param token_update_parameters: The parameters for updating a token. Is either a + TokenUpdateParameters type or a IO[bytes] type. Required. + :type token_update_parameters: ~azure.mgmt.containerregistry.models.TokenUpdateParameters or + ~azure.mgmt.containerregistry.types.TokenUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PipelineRun] = kwargs.pop("cls", None) + cls: ClsType[_models.Token] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_initial( + raw_result = await self._update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - pipeline_run_name=pipeline_run_name, - pipeline_run_create_parameters=pipeline_run_create_parameters, + token_name=token_name, + token_update_parameters=token_update_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -11228,7 +7687,7 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.PipelineRun, response.json()) + deserialized = _deserialize(_models.Token, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -11246,31 +7705,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.PipelineRun].from_continuation_token( + return AsyncLROPoller[_models.Token].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.PipelineRun]( + return AsyncLROPoller[_models.Token]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "pipeline_run_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def _delete_initial( - self, resource_group_name: str, registry_name: str, pipeline_run_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11285,10 +7731,10 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_pipeline_runs_delete_request( + _request = build_tokens_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - pipeline_run_name=pipeline_run_name, + token_name=token_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11332,31 +7778,18 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "pipeline_run_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) async def begin_delete( - self, resource_group_name: str, registry_name: str, pipeline_run_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a pipeline run from a container registry. + """Deletes a token from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str + :param token_name: The name of the token. Required. + :type token_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -11372,7 +7805,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - pipeline_run_name=pipeline_run_name, + token_name=token_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -11407,32 +7840,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": ["api_version", "subscription_id", "resource_group_name", "registry_name", "accept"] - }, - api_versions_list=["2026-10-15-preview"], - ) - def list( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.PipelineRun"]: - """Lists all the pipeline runs for the specified container registry. + def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Token"]: + """Lists all the tokens for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of PipelineRun - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.PipelineRun] + :return: An iterator like instance of Token + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.PipelineRun]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Token]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11445,7 +7868,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_pipeline_runs_list_request( + _request = build_tokens_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, @@ -11488,7 +7911,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.PipelineRun], + List[_models.Token], deserialized.get("value", []), ) if cls: diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/__init__.py index 145ac976cfa9..aa0290ffe66d 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/__init__.py @@ -16,15 +16,6 @@ from ._models import ( # type: ignore ActivationProperties, Actor, - AdditionalAuthenticationProperties, - AdditionalAuthenticationUpdateProperties, - Archive, - ArchivePackageSourceProperties, - ArchiveProperties, - ArchiveUpdateParameters, - ArchiveUpdateProperties, - ArchiveVersion, - ArchiveVersionProperties, AuthCredential, AzureADAuthenticationAsArmPolicy, CacheRule, @@ -41,11 +32,7 @@ CredentialSetProperties, CredentialSetUpdateParameters, CredentialSetUpdateProperties, - EcrAuthenticationProperties, - EcrAuthenticationUpdateProperties, EncryptionProperty, - EntraFederatedIdentityCredentialAuthenticationProperties, - EntraFederatedIdentityCredentialAuthenticationUpdateProperties, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, @@ -54,27 +41,18 @@ EventInfo, EventRequestMessage, EventResponseMessage, - ExportPipeline, - ExportPipelineProperties, - ExportPipelineTargetProperties, ExportPolicy, - GarAuthenticationProperties, - GarAuthenticationUpdateProperties, GarbageCollectionProperties, GenerateCredentialsParameters, GenerateCredentialsResult, IPRule, IdentityProperties, ImportImageParameters, - ImportPipeline, - ImportPipelineProperties, - ImportPipelineSourceProperties, ImportSource, ImportSourceCredentials, KeyVaultProperties, LoggingProperties, LoginServerProperties, - ManagedServiceIdentity, NetworkRuleSet, OperationDefinition, OperationDisplayDefinition, @@ -83,16 +61,6 @@ OperationPropertiesDefinition, OperationServiceSpecificationDefinition, ParentProperties, - PipelineRun, - PipelineRunProperties, - PipelineRunRequest, - PipelineRunResponse, - PipelineRunSourceProperties, - PipelineRunTargetProperties, - PipelineSourceTriggerDescriptor, - PipelineSourceTriggerProperties, - PipelineTriggerDescriptor, - PipelineTriggerProperties, Policies, PrivateEndpoint, PrivateEndpointConnection, @@ -100,7 +68,6 @@ PrivateLinkResource, PrivateLinkResourceProperties, PrivateLinkServiceConnectionState, - ProgressProperties, ProxyResource, QuarantinePolicy, RegenerateCredentialParameters, @@ -111,7 +78,6 @@ RegistryPassword, RegistryProperties, RegistryPropertiesUpdateParameters, - RegistrySyncResult, RegistryUpdateParameters, RegistryUsage, RegistryUsageListResult, @@ -127,7 +93,6 @@ ScopeMapPropertiesUpdateParameters, ScopeMapUpdateParameters, Sku, - SoftDeletePolicy, Source, Status, StatusDetailProperties, @@ -146,7 +111,6 @@ TokenUpdateProperties, TrackedResource, TrustPolicy, - UserAssignedIdentity, UserIdentityProperties, VirtualNetworkRule, Webhook, @@ -161,10 +125,7 @@ Action, ActionsRequired, ActivationStatus, - AdditionalAuthenticationType, AuditLogStatus, - AuthType, - AutoGeneratedDomainNameLabelScope, AzureADAuthenticationAsArmPolicyStatus, CertificateType, ConnectedRegistryMode, @@ -180,15 +141,8 @@ ExportPolicyStatus, ImportMode, LogLevel, - ManagedServiceIdentityType, - MetadataSearch, NetworkRuleBypassOptions, - PackageSourceType, PasswordName, - PipelineOptions, - PipelineRunSourceType, - PipelineRunTargetType, - PipelineSourceType, PolicyStatus, ProvisioningState, PublicNetworkAccess, @@ -198,18 +152,13 @@ RoleAssignmentMode, SkuName, SkuTier, - StorageAccessMode, - SyncState, - SyncTrigger, TlsStatus, TokenCertificateName, TokenPasswordName, TokenStatus, - TriggerStatus, TrustPolicyType, WebhookAction, WebhookStatus, - WritableCacheRepos, ZoneRedundancy, ) from ._patch import __all__ as _patch_all @@ -219,15 +168,6 @@ __all__ = [ "ActivationProperties", "Actor", - "AdditionalAuthenticationProperties", - "AdditionalAuthenticationUpdateProperties", - "Archive", - "ArchivePackageSourceProperties", - "ArchiveProperties", - "ArchiveUpdateParameters", - "ArchiveUpdateProperties", - "ArchiveVersion", - "ArchiveVersionProperties", "AuthCredential", "AzureADAuthenticationAsArmPolicy", "CacheRule", @@ -244,11 +184,7 @@ "CredentialSetProperties", "CredentialSetUpdateParameters", "CredentialSetUpdateProperties", - "EcrAuthenticationProperties", - "EcrAuthenticationUpdateProperties", "EncryptionProperty", - "EntraFederatedIdentityCredentialAuthenticationProperties", - "EntraFederatedIdentityCredentialAuthenticationUpdateProperties", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", @@ -257,27 +193,18 @@ "EventInfo", "EventRequestMessage", "EventResponseMessage", - "ExportPipeline", - "ExportPipelineProperties", - "ExportPipelineTargetProperties", "ExportPolicy", - "GarAuthenticationProperties", - "GarAuthenticationUpdateProperties", "GarbageCollectionProperties", "GenerateCredentialsParameters", "GenerateCredentialsResult", "IPRule", "IdentityProperties", "ImportImageParameters", - "ImportPipeline", - "ImportPipelineProperties", - "ImportPipelineSourceProperties", "ImportSource", "ImportSourceCredentials", "KeyVaultProperties", "LoggingProperties", "LoginServerProperties", - "ManagedServiceIdentity", "NetworkRuleSet", "OperationDefinition", "OperationDisplayDefinition", @@ -286,16 +213,6 @@ "OperationPropertiesDefinition", "OperationServiceSpecificationDefinition", "ParentProperties", - "PipelineRun", - "PipelineRunProperties", - "PipelineRunRequest", - "PipelineRunResponse", - "PipelineRunSourceProperties", - "PipelineRunTargetProperties", - "PipelineSourceTriggerDescriptor", - "PipelineSourceTriggerProperties", - "PipelineTriggerDescriptor", - "PipelineTriggerProperties", "Policies", "PrivateEndpoint", "PrivateEndpointConnection", @@ -303,7 +220,6 @@ "PrivateLinkResource", "PrivateLinkResourceProperties", "PrivateLinkServiceConnectionState", - "ProgressProperties", "ProxyResource", "QuarantinePolicy", "RegenerateCredentialParameters", @@ -314,7 +230,6 @@ "RegistryPassword", "RegistryProperties", "RegistryPropertiesUpdateParameters", - "RegistrySyncResult", "RegistryUpdateParameters", "RegistryUsage", "RegistryUsageListResult", @@ -330,7 +245,6 @@ "ScopeMapPropertiesUpdateParameters", "ScopeMapUpdateParameters", "Sku", - "SoftDeletePolicy", "Source", "Status", "StatusDetailProperties", @@ -349,7 +263,6 @@ "TokenUpdateProperties", "TrackedResource", "TrustPolicy", - "UserAssignedIdentity", "UserIdentityProperties", "VirtualNetworkRule", "Webhook", @@ -361,10 +274,7 @@ "Action", "ActionsRequired", "ActivationStatus", - "AdditionalAuthenticationType", "AuditLogStatus", - "AuthType", - "AutoGeneratedDomainNameLabelScope", "AzureADAuthenticationAsArmPolicyStatus", "CertificateType", "ConnectedRegistryMode", @@ -380,15 +290,8 @@ "ExportPolicyStatus", "ImportMode", "LogLevel", - "ManagedServiceIdentityType", - "MetadataSearch", "NetworkRuleBypassOptions", - "PackageSourceType", "PasswordName", - "PipelineOptions", - "PipelineRunSourceType", - "PipelineRunTargetType", - "PipelineSourceType", "PolicyStatus", "ProvisioningState", "PublicNetworkAccess", @@ -398,18 +301,13 @@ "RoleAssignmentMode", "SkuName", "SkuTier", - "StorageAccessMode", - "SyncState", - "SyncTrigger", "TlsStatus", "TokenCertificateName", "TokenPasswordName", "TokenStatus", - "TriggerStatus", "TrustPolicyType", "WebhookAction", "WebhookStatus", - "WritableCacheRepos", "ZoneRedundancy", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/_enums.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/_enums.py index 31f25f293726..5239e4f40f3c 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/_enums.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/_enums.py @@ -35,18 +35,6 @@ class ActivationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """INACTIVE.""" -class AdditionalAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of authentication configuration used by a cache rule to access an upstream registry.""" - - GOOGLE_ARTIFACT_REGISTRY = "GoogleArtifactRegistry" - """Google Artifact Registry (GAR) authentication via workload identity federation.""" - AWS_ELASTIC_CONTAINER_REGISTRY = "AwsElasticContainerRegistry" - """Amazon Elastic Container Registry (ECR) authentication via workload identity federation.""" - ENTRA_FEDERATED_IDENTITY_CREDENTIAL = "EntraFederatedIdentityCredential" - """Microsoft Entra authentication via a federated identity credential on an application in another - tenant.""" - - class AuditLogStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates whether audit logs are enabled on the connected registry.""" @@ -56,32 +44,6 @@ class AuditLogStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DISABLED.""" -class AuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The authentication type used for the connected registry to sync with its parent.""" - - SYNC_TOKEN = "SyncToken" - """Sync authentication is done using ACR tokens.""" - MANAGED_IDENTITY = "ManagedIdentity" - """Sync authentication is done using managed identity.""" - - -class AutoGeneratedDomainNameLabelScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The auto generated domain name label of the container registry. This value defaults to - \"Unsecure\". - """ - - UNSECURE = "Unsecure" - """UNSECURE.""" - TENANT_REUSE = "TenantReuse" - """TENANT_REUSE.""" - SUBSCRIPTION_REUSE = "SubscriptionReuse" - """SUBSCRIPTION_REUSE.""" - RESOURCE_GROUP_REUSE = "ResourceGroupReuse" - """RESOURCE_GROUP_REUSE.""" - NO_REUSE = "NoReuse" - """NO_REUSE.""" - - class AzureADAuthenticationAsArmPolicyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The value that indicates whether the policy is enabled or not.""" @@ -235,30 +197,6 @@ class LogLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """NONE.""" -class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - """No managed identity.""" - SYSTEM_ASSIGNED = "SystemAssigned" - """System assigned managed identity.""" - USER_ASSIGNED = "UserAssigned" - """User assigned managed identity.""" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - """System and user assigned managed identity.""" - - -class MetadataSearch(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines whether registry artifacts are indexed for metadata search.""" - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - - class NetworkRuleBypassOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Whether to allow trusted Azure services to access a network restricted registry.""" @@ -268,13 +206,6 @@ class NetworkRuleBypassOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): """NONE.""" -class PackageSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of package source for a archive.""" - - REMOTE = "remote" - """REMOTE.""" - - class PasswordName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The password name.""" @@ -284,40 +215,6 @@ class PasswordName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """PASSWORD2.""" -class PipelineOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of PipelineOptions.""" - - OVERWRITE_TAGS = "OverwriteTags" - """OVERWRITE_TAGS.""" - OVERWRITE_BLOBS = "OverwriteBlobs" - """OVERWRITE_BLOBS.""" - DELETE_SOURCE_BLOB_ON_SUCCESS = "DeleteSourceBlobOnSuccess" - """DELETE_SOURCE_BLOB_ON_SUCCESS.""" - CONTINUE_ON_ERRORS = "ContinueOnErrors" - """CONTINUE_ON_ERRORS.""" - - -class PipelineRunSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the source.""" - - AZURE_STORAGE_BLOB = "AzureStorageBlob" - """AZURE_STORAGE_BLOB.""" - - -class PipelineRunTargetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the target.""" - - AZURE_STORAGE_BLOB = "AzureStorageBlob" - """AZURE_STORAGE_BLOB.""" - - -class PipelineSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of source for the import pipeline.""" - - AZURE_STORAGE_BLOB_CONTAINER = "AzureStorageBlobContainer" - """AZURE_STORAGE_BLOB_CONTAINER.""" - - class PolicyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The value that indicates whether the policy is enabled or not.""" @@ -419,45 +316,6 @@ class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """PREMIUM.""" -class StorageAccessMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The storage access mode used for the customer storage account.""" - - MANAGED_IDENTITY = "ManagedIdentity" - """Managed Identity access mode.""" - SAS_TOKEN = "SasToken" - """SAS Token access mode.""" - - -class SyncState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The action that triggered the most recent registry sync.""" - - NOT_ACTIVATED = "NotActivated" - """Connected Registry is not activated.""" - SYNCING = "Syncing" - """Connected Registry is syncing.""" - FAILED = "Failed" - """Connected Registry sync failed.""" - SUCCEEDED = "Succeeded" - """Connected Registry sync succeeded.""" - TIMED_OUT = "TimedOut" - """Connected Registry sync timed out.""" - PENDING = "Pending" - """Connected Registry sync is pending.""" - - -class SyncTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of the connected registry's most recent sync.""" - - SYNC_TOKEN_UPDATE = "SyncTokenUpdate" - """Connected Registry sync was triggered by a sync token update.""" - INITIAL_SYNC = "InitialSync" - """Connected Registry sync was triggered by an initial sync during activation.""" - MANUAL_RESYNC = "ManualResync" - """Connected Registry sync was triggered by a manual resync request.""" - RECOVERY_SERVICE = "RecoveryService" - """Connected Registry sync was triggered by the Connected Registry's recovery service.""" - - class TlsStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates whether HTTPS is enabled for the login server.""" @@ -494,15 +352,6 @@ class TokenStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DISABLED.""" -class TriggerStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current status of the source trigger.""" - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - - class TrustPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of trust policy.""" @@ -534,15 +383,6 @@ class WebhookStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DISABLED.""" -class WritableCacheRepos(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether to allow cache operations that write to repositories in this registry.""" - - ENABLED = "Enabled" - """Cache write operations are enabled.""" - DISABLED = "Disabled" - """Cache write operations are disabled.""" - - class ZoneRedundancy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Whether or not zone redundancy is enabled for this container registry.""" diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/_models.py index 9355e997de5a..34dcc637f679 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/_models.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models/_models.py @@ -9,10 +9,9 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload -from .._utils.model_base import Model as _Model, rest_discriminator, rest_field -from ._enums import AdditionalAuthenticationType +from .._utils.model_base import Model as _Model, rest_field if TYPE_CHECKING: from .. import models as _models @@ -60,33 +59,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AdditionalAuthenticationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Authentication configuration used by a cache rule to access an upstream registry. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - EcrAuthenticationProperties, EntraFederatedIdentityCredentialAuthenticationProperties, - GarAuthenticationProperties +class AuthCredential(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Authentication credential stored for an upstream. - :ivar authentication_type: Authentication type discriminator. The authentication type cannot - change once configured. Required. Known values are: "GoogleArtifactRegistry", - "AwsElasticContainerRegistry", and "EntraFederatedIdentityCredential". - :vartype authentication_type: str or - ~azure.mgmt.containerregistry.models.AdditionalAuthenticationType + :ivar name: The name of the credential. "Credential1" + :vartype name: str or ~azure.mgmt.containerregistry.models.CredentialName + :ivar username_secret_identifier: KeyVault Secret URI for accessing the username. + :vartype username_secret_identifier: str + :ivar password_secret_identifier: KeyVault Secret URI for accessing the password. + :vartype password_secret_identifier: str + :ivar credential_health: This provides data pertaining to the health of the auth credential. + :vartype credential_health: ~azure.mgmt.containerregistry.models.CredentialHealth """ - __mapping__: dict[str, _Model] = {} - authentication_type: str = rest_discriminator( - name="authenticationType", visibility=["read", "create", "update", "delete", "query"] + name: Optional[Union[str, "_models.CredentialName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the credential. \"Credential1\"""" + username_secret_identifier: Optional[str] = rest_field( + name="usernameSecretIdentifier", visibility=["read", "create", "update", "delete", "query"] + ) + """KeyVault Secret URI for accessing the username.""" + password_secret_identifier: Optional[str] = rest_field( + name="passwordSecretIdentifier", visibility=["read", "create", "update", "delete", "query"] ) - """Authentication type discriminator. The authentication type cannot change once configured. - Required. Known values are: \"GoogleArtifactRegistry\", \"AwsElasticContainerRegistry\", and - \"EntraFederatedIdentityCredential\".""" + """KeyVault Secret URI for accessing the password.""" + credential_health: Optional["_models.CredentialHealth"] = rest_field(name="credentialHealth", visibility=["read"]) + """This provides data pertaining to the health of the auth credential.""" @overload def __init__( self, *, - authentication_type: str, + name: Optional[Union[str, "_models.CredentialName"]] = None, + username_secret_identifier: Optional[str] = None, + password_secret_identifier: Optional[str] = None, ) -> None: ... @overload @@ -100,39 +107,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AdditionalAuthenticationUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Partial authentication configuration for a cache rule. Omitted fields retain their current - values. When authentication is first configured, all required fields of the selected - authentication type must be supplied. Changing an existing authentication type is not - supported. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - EcrAuthenticationUpdateProperties, - EntraFederatedIdentityCredentialAuthenticationUpdateProperties, - GarAuthenticationUpdateProperties +class AzureADAuthenticationAsArmPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The policy for using Azure Resource Manager audience token for a container registry. - :ivar authentication_type: The existing authentication type, or the type to configure when no - authentication exists. This discriminator is required, but changing an existing authentication - type is not supported. Required. Known values are: "GoogleArtifactRegistry", - "AwsElasticContainerRegistry", and "EntraFederatedIdentityCredential". - :vartype authentication_type: str or - ~azure.mgmt.containerregistry.models.AdditionalAuthenticationType + :ivar status: The value that indicates whether the policy is enabled or not. Known values are: + "enabled" and "disabled". + :vartype status: str or + ~azure.mgmt.containerregistry.models.AzureADAuthenticationAsArmPolicyStatus """ - __mapping__: dict[str, _Model] = {} - authentication_type: str = rest_discriminator( - name="authenticationType", visibility=["read", "create", "update", "delete", "query"] + status: Optional[Union[str, "_models.AzureADAuthenticationAsArmPolicyStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The existing authentication type, or the type to configure when no authentication exists. This - discriminator is required, but changing an existing authentication type is not supported. - Required. Known values are: \"GoogleArtifactRegistry\", \"AwsElasticContainerRegistry\", and - \"EntraFederatedIdentityCredential\".""" + """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\" + and \"disabled\".""" @overload def __init__( self, *, - authentication_type: str, + status: Optional[Union[str, "_models.AzureADAuthenticationAsArmPolicyStatus"]] = None, ) -> None: ... @overload @@ -191,8 +185,8 @@ class ProxyResource(Resource): """ -class Archive(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An object that represents a archive for a container registry. +class CacheRule(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """An object that represents a cache rule for a container registry. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -205,20 +199,20 @@ class Archive(ProxyResource): # pylint: disable=docstring-keyword-should-match- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.containerregistry.models.SystemData - :ivar properties: The properties of the archive. - :vartype properties: ~azure.mgmt.containerregistry.models.ArchiveProperties + :ivar properties: The properties of the cache rule. + :vartype properties: ~azure.mgmt.containerregistry.models.CacheRuleProperties """ - properties: Optional["_models.ArchiveProperties"] = rest_field( + properties: Optional["_models.CacheRuleProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The properties of the archive.""" + """The properties of the cache rule.""" __flattened_items = [ - "package_source", - "published_version", - "repository_endpoint_prefix", - "repository_endpoint", + "credential_set_resource_id", + "source_repository", + "target_repository", + "creation_date", "provisioning_state", ] @@ -226,7 +220,7 @@ class Archive(ProxyResource): # pylint: disable=docstring-keyword-should-match- def __init__( self, *, - properties: Optional["_models.ArchiveProperties"] = None, + properties: Optional["_models.CacheRuleProperties"] = None, ) -> None: ... @overload @@ -258,83 +252,52 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class ArchivePackageSourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of the archive package source. - - :ivar type: The type of package source for a archive. "remote" - :vartype type: str or ~azure.mgmt.containerregistry.models.PackageSourceType - :ivar url: The external repository url. - :vartype url: str - """ - - type: Optional[Union[str, "_models.PackageSourceType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of package source for a archive. \"remote\"""" - url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The external repository url.""" - - @overload - def __init__( - self, - *, - type: Optional[Union[str, "_models.PackageSourceType"]] = None, - url: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ArchiveProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of a archive. +class CacheRuleProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of a cache rule. - :ivar package_source: The package source of the archive. - :vartype package_source: ~azure.mgmt.containerregistry.models.ArchivePackageSourceProperties - :ivar published_version: The published version of the archive. - :vartype published_version: str - :ivar repository_endpoint_prefix: - :vartype repository_endpoint_prefix: str - :ivar repository_endpoint: - :vartype repository_endpoint: str - :ivar provisioning_state: The provisioning state of the archive at the time the operation was - called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and - "Canceled". + :ivar credential_set_resource_id: The ARM resource ID of the credential store which is + associated with the cache rule. + :vartype credential_set_resource_id: str + :ivar source_repository: Source repository pulled from upstream. + :vartype source_repository: str + :ivar target_repository: Target repository specified in docker pull command. Eg: docker pull + myregistry.azurecr.io/{targetRepository}:{tag}. + :vartype target_repository: str + :ivar creation_date: The creation date of the cache rule. + :vartype creation_date: ~datetime.datetime + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating", + "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState """ - package_source: Optional["_models.ArchivePackageSourceProperties"] = rest_field( - name="packageSource", visibility=["read", "create", "update", "delete", "query"] + credential_set_resource_id: Optional[str] = rest_field( + name="credentialSetResourceId", visibility=["read", "create", "update", "delete", "query"] ) - """The package source of the archive.""" - published_version: Optional[str] = rest_field( - name="publishedVersion", visibility=["read", "create", "update", "delete", "query"] + """The ARM resource ID of the credential store which is associated with the cache rule.""" + source_repository: Optional[str] = rest_field( + name="sourceRepository", visibility=["read", "create", "update", "delete", "query"] ) - """The published version of the archive.""" - repository_endpoint_prefix: Optional[str] = rest_field( - name="repositoryEndpointPrefix", visibility=["read", "create", "update", "delete", "query"] + """Source repository pulled from upstream.""" + target_repository: Optional[str] = rest_field( + name="targetRepository", visibility=["read", "create", "update", "delete", "query"] ) - repository_endpoint: Optional[str] = rest_field(name="repositoryEndpoint", visibility=["read"]) + """Target repository specified in docker pull command. Eg: docker pull + myregistry.azurecr.io/{targetRepository}:{tag}.""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """The creation date of the cache rule.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) - """The provisioning state of the archive at the time the operation was called. Known values are: - \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" + """Provisioning state of the resource. Known values are: \"Creating\", \"Updating\", \"Deleting\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" @overload def __init__( self, *, - package_source: Optional["_models.ArchivePackageSourceProperties"] = None, - published_version: Optional[str] = None, - repository_endpoint_prefix: Optional[str] = None, + credential_set_resource_id: Optional[str] = None, + source_repository: Optional[str] = None, + target_repository: Optional[str] = None, ) -> None: ... @overload @@ -348,25 +311,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArchiveUpdateParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The parameters for updating a archive. +class CacheRuleUpdateParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The parameters for updating a cache rule. - :ivar properties: The properties of the connected registry update parameters. - :vartype properties: ~azure.mgmt.containerregistry.models.ArchiveUpdateProperties + :ivar properties: The properties of the cache rule update parameters. + :vartype properties: ~azure.mgmt.containerregistry.models.CacheRuleUpdateProperties """ - properties: Optional["_models.ArchiveUpdateProperties"] = rest_field( + properties: Optional["_models.CacheRuleUpdateProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The properties of the connected registry update parameters.""" + """The properties of the cache rule update parameters.""" - __flattened_items = ["published_version"] + __flattened_items = ["credential_set_resource_id"] @overload def __init__( self, *, - properties: Optional["_models.ArchiveUpdateProperties"] = None, + properties: Optional["_models.CacheRuleUpdateProperties"] = None, ) -> None: ... @overload @@ -398,23 +361,59 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class ArchiveUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of a archive. +class CacheRuleUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The parameters for updating cache rule properties. + + :ivar credential_set_resource_id: The ARM resource ID of the credential store which is + associated with the Cache rule. + :vartype credential_set_resource_id: str + """ + + credential_set_resource_id: Optional[str] = rest_field( + name="credentialSetResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The ARM resource ID of the credential store which is associated with the Cache rule.""" + + @overload + def __init__( + self, + *, + credential_set_resource_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CallbackConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The configuration of service URI and custom headers for the webhook. - :ivar published_version: The published version of the archive. - :vartype published_version: str + :ivar service_uri: The service URI for the webhook to post notifications. Required. + :vartype service_uri: str + :ivar custom_headers: Custom headers that will be added to the webhook notifications. + :vartype custom_headers: dict[str, str] """ - published_version: Optional[str] = rest_field( - name="publishedVersion", visibility=["read", "create", "update", "delete", "query"] + service_uri: str = rest_field(name="serviceUri", visibility=["read", "create", "update", "delete", "query"]) + """The service URI for the webhook to post notifications. Required.""" + custom_headers: Optional[dict[str, str]] = rest_field( + name="customHeaders", visibility=["read", "create", "update", "delete", "query"] ) - """The published version of the archive.""" + """Custom headers that will be added to the webhook notifications.""" @overload def __init__( self, *, - published_version: Optional[str] = None, + service_uri: str, + custom_headers: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -428,8 +427,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArchiveVersion(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An object that represents an export pipeline for a container registry. +class ConnectedRegistry(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """An object that represents a connected registry for a container registry. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -442,22 +441,36 @@ class ArchiveVersion(ProxyResource): # pylint: disable=docstring-keyword-should :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.containerregistry.models.SystemData - :ivar properties: The properties of the archive. - :vartype properties: ~azure.mgmt.containerregistry.models.ArchiveVersionProperties + :ivar properties: The properties of the connected registry. + :vartype properties: ~azure.mgmt.containerregistry.models.ConnectedRegistryProperties """ - properties: Optional["_models.ArchiveVersionProperties"] = rest_field( + properties: Optional["_models.ConnectedRegistryProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The properties of the archive.""" + """The properties of the connected registry.""" - __flattened_items = ["provisioning_state", "archive_version_error_message"] + __flattened_items = [ + "provisioning_state", + "mode", + "version", + "connection_state", + "last_activity_time", + "activation", + "parent", + "client_token_ids", + "login_server", + "logging", + "status_details", + "notifications_list", + "garbage_collection", + ] @overload def __init__( self, *, - properties: Optional["_models.ArchiveVersionProperties"] = None, + properties: Optional["_models.ConnectedRegistryProperties"] = None, ) -> None: ... @overload @@ -489,114 +502,103 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class ArchiveVersionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of an archive version. +class ConnectedRegistryProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of a connected registry. - :ivar provisioning_state: The provisioning state of the archive at the time the operation was - called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and - "Canceled". + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating", + "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState - :ivar archive_version_error_message: The detailed error message for the archive version in the - case of failure. - :vartype archive_version_error_message: str + :ivar mode: The mode of the connected registry resource that indicates the permissions of the + registry. Required. Known values are: "ReadWrite", "ReadOnly", "Registry", and "Mirror". + :vartype mode: str or ~azure.mgmt.containerregistry.models.ConnectedRegistryMode + :ivar version: The current version of ACR runtime on the connected registry. + :vartype version: str + :ivar connection_state: The current connection state of the connected registry. Known values + are: "Online", "Offline", "Syncing", and "Unhealthy". + :vartype connection_state: str or ~azure.mgmt.containerregistry.models.ConnectionState + :ivar last_activity_time: The last activity time of the connected registry. + :vartype last_activity_time: ~datetime.datetime + :ivar activation: The activation properties of the connected registry. + :vartype activation: ~azure.mgmt.containerregistry.models.ActivationProperties + :ivar parent: The parent of the connected registry. Required. + :vartype parent: ~azure.mgmt.containerregistry.models.ParentProperties + :ivar client_token_ids: The list of the ACR token resource IDs used to authenticate clients to + the connected registry. + :vartype client_token_ids: list[str] + :ivar login_server: The login server properties of the connected registry. + :vartype login_server: ~azure.mgmt.containerregistry.models.LoginServerProperties + :ivar logging: The logging properties of the connected registry. + :vartype logging: ~azure.mgmt.containerregistry.models.LoggingProperties + :ivar status_details: The list of current statuses of the connected registry. + :vartype status_details: list[~azure.mgmt.containerregistry.models.StatusDetailProperties] + :ivar notifications_list: The list of notifications subscription information for the connected + registry. + :vartype notifications_list: list[str] + :ivar garbage_collection: The garbage collection properties of the connected registry. + :vartype garbage_collection: ~azure.mgmt.containerregistry.models.GarbageCollectionProperties """ provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) - """The provisioning state of the archive at the time the operation was called. Known values are: - \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - archive_version_error_message: Optional[str] = rest_field( - name="archiveVersionErrorMessage", visibility=["read", "create", "update", "delete", "query"] - ) - """The detailed error message for the archive version in the case of failure.""" - - @overload - def __init__( - self, - *, - archive_version_error_message: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AuthCredential(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Authentication credential stored for an upstream. - - :ivar name: The name of the credential. "Credential1" - :vartype name: str or ~azure.mgmt.containerregistry.models.CredentialName - :ivar username_secret_identifier: KeyVault Secret URI for accessing the username. - :vartype username_secret_identifier: str - :ivar password_secret_identifier: KeyVault Secret URI for accessing the password. - :vartype password_secret_identifier: str - :ivar credential_health: This provides data pertaining to the health of the auth credential. - :vartype credential_health: ~azure.mgmt.containerregistry.models.CredentialHealth - """ - - name: Optional[Union[str, "_models.CredentialName"]] = rest_field( + """Provisioning state of the resource. Known values are: \"Creating\", \"Updating\", \"Deleting\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + mode: Union[str, "_models.ConnectedRegistryMode"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The name of the credential. \"Credential1\"""" - username_secret_identifier: Optional[str] = rest_field( - name="usernameSecretIdentifier", visibility=["read", "create", "update", "delete", "query"] + """The mode of the connected registry resource that indicates the permissions of the registry. + Required. Known values are: \"ReadWrite\", \"ReadOnly\", \"Registry\", and \"Mirror\".""" + version: Optional[str] = rest_field(visibility=["read"]) + """The current version of ACR runtime on the connected registry.""" + connection_state: Optional[Union[str, "_models.ConnectionState"]] = rest_field( + name="connectionState", visibility=["read"] ) - """KeyVault Secret URI for accessing the username.""" - password_secret_identifier: Optional[str] = rest_field( - name="passwordSecretIdentifier", visibility=["read", "create", "update", "delete", "query"] + """The current connection state of the connected registry. Known values are: \"Online\", + \"Offline\", \"Syncing\", and \"Unhealthy\".""" + last_activity_time: Optional[datetime.datetime] = rest_field( + name="lastActivityTime", visibility=["read"], format="rfc3339" ) - """KeyVault Secret URI for accessing the password.""" - credential_health: Optional["_models.CredentialHealth"] = rest_field(name="credentialHealth", visibility=["read"]) - """This provides data pertaining to the health of the auth credential.""" - - @overload - def __init__( - self, - *, - name: Optional[Union[str, "_models.CredentialName"]] = None, - username_secret_identifier: Optional[str] = None, - password_secret_identifier: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AzureADAuthenticationAsArmPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The policy for using Azure Resource Manager audience token for a container registry. - - :ivar status: The value that indicates whether the policy is enabled or not. Known values are: - "enabled" and "disabled". - :vartype status: str or - ~azure.mgmt.containerregistry.models.AzureADAuthenticationAsArmPolicyStatus - """ - - status: Optional[Union[str, "_models.AzureADAuthenticationAsArmPolicyStatus"]] = rest_field( + """The last activity time of the connected registry.""" + activation: Optional["_models.ActivationProperties"] = rest_field(visibility=["read"]) + """The activation properties of the connected registry.""" + parent: "_models.ParentProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parent of the connected registry. Required.""" + client_token_ids: Optional[list[str]] = rest_field( + name="clientTokenIds", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of the ACR token resource IDs used to authenticate clients to the connected registry.""" + login_server: Optional["_models.LoginServerProperties"] = rest_field( + name="loginServer", visibility=["read", "create", "update", "delete", "query"] + ) + """The login server properties of the connected registry.""" + logging: Optional["_models.LoggingProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\" - and \"disabled\".""" + """The logging properties of the connected registry.""" + status_details: Optional[list["_models.StatusDetailProperties"]] = rest_field( + name="statusDetails", visibility=["read"] + ) + """The list of current statuses of the connected registry.""" + notifications_list: Optional[list[str]] = rest_field( + name="notificationsList", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of notifications subscription information for the connected registry.""" + garbage_collection: Optional["_models.GarbageCollectionProperties"] = rest_field( + name="garbageCollection", visibility=["read", "create", "update", "delete", "query"] + ) + """The garbage collection properties of the connected registry.""" @overload def __init__( self, *, - status: Optional[Union[str, "_models.AzureADAuthenticationAsArmPolicyStatus"]] = None, + mode: Union[str, "_models.ConnectedRegistryMode"], + parent: "_models.ParentProperties", + client_token_ids: Optional[list[str]] = None, + login_server: Optional["_models.LoginServerProperties"] = None, + logging: Optional["_models.LoggingProperties"] = None, + notifications_list: Optional[list[str]] = None, + garbage_collection: Optional["_models.GarbageCollectionProperties"] = None, ) -> None: ... @overload @@ -610,50 +612,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CacheRule(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An object that represents a cache rule for a container registry. +class ConnectedRegistryUpdateParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The parameters for updating a connected registry. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the private link resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.containerregistry.models.SystemData - :ivar properties: The properties of the cache rule. - :vartype properties: ~azure.mgmt.containerregistry.models.CacheRuleProperties - :ivar identity: The identity of the cache rule. - :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties + :ivar properties: The properties of the connected registry update parameters. + :vartype properties: ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateProperties """ - properties: Optional["_models.CacheRuleProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties of the cache rule.""" - identity: Optional["_models.IdentityProperties"] = rest_field( + properties: Optional["_models.ConnectedRegistryUpdateProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The identity of the cache rule.""" + """The properties of the connected registry update parameters.""" - __flattened_items = [ - "credential_set_resource_id", - "additional_authentication_properties", - "source_repository", - "target_repository", - "creation_date", - "provisioning_state", - ] + __flattened_items = ["sync_properties", "logging", "client_token_ids", "notifications_list", "garbage_collection"] @overload def __init__( self, *, - properties: Optional["_models.CacheRuleProperties"] = None, - identity: Optional["_models.IdentityProperties"] = None, + properties: Optional["_models.ConnectedRegistryUpdateProperties"] = None, ) -> None: ... @overload @@ -685,61 +662,53 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class CacheRuleProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of a cache rule. +class ConnectedRegistryUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The parameters for updating token properties. - :ivar credential_set_resource_id: The ARM resource ID of the credential store which is - associated with the cache rule. - :vartype credential_set_resource_id: str - :ivar additional_authentication_properties: Authentication configuration used by the cache rule - to access the upstream source repository. - :vartype additional_authentication_properties: - ~azure.mgmt.containerregistry.models.AdditionalAuthenticationProperties - :ivar source_repository: Source repository pulled from upstream. - :vartype source_repository: str - :ivar target_repository: Target repository specified in docker pull command. Eg: docker pull - myregistry.azurecr.io/{targetRepository}:{tag}. - :vartype target_repository: str - :ivar creation_date: The creation date of the cache rule. - :vartype creation_date: ~datetime.datetime - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating", - "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState + :ivar sync_properties: The sync properties of the connected registry with its parent. + :vartype sync_properties: ~azure.mgmt.containerregistry.models.SyncUpdateProperties + :ivar logging: The logging properties of the connected registry. + :vartype logging: ~azure.mgmt.containerregistry.models.LoggingProperties + :ivar client_token_ids: The list of the ACR token resource IDs used to authenticate clients to + the connected registry. + :vartype client_token_ids: list[str] + :ivar notifications_list: The list of notifications subscription information for the connected + registry. + :vartype notifications_list: list[str] + :ivar garbage_collection: The garbage collection properties of the connected registry. + :vartype garbage_collection: ~azure.mgmt.containerregistry.models.GarbageCollectionProperties """ - credential_set_resource_id: Optional[str] = rest_field( - name="credentialSetResourceId", visibility=["read", "create", "update", "delete", "query"] + sync_properties: Optional["_models.SyncUpdateProperties"] = rest_field( + name="syncProperties", visibility=["read", "create", "update", "delete", "query"] ) - """The ARM resource ID of the credential store which is associated with the cache rule.""" - additional_authentication_properties: Optional["_models.AdditionalAuthenticationProperties"] = rest_field( - name="additionalAuthenticationProperties", visibility=["read", "create", "update", "delete", "query"] + """The sync properties of the connected registry with its parent.""" + logging: Optional["_models.LoggingProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Authentication configuration used by the cache rule to access the upstream source repository.""" - source_repository: Optional[str] = rest_field( - name="sourceRepository", visibility=["read", "create", "update", "delete", "query"] + """The logging properties of the connected registry.""" + client_token_ids: Optional[list[str]] = rest_field( + name="clientTokenIds", visibility=["read", "create", "update", "delete", "query"] ) - """Source repository pulled from upstream.""" - target_repository: Optional[str] = rest_field( - name="targetRepository", visibility=["read", "create", "update", "delete", "query"] + """The list of the ACR token resource IDs used to authenticate clients to the connected registry.""" + notifications_list: Optional[list[str]] = rest_field( + name="notificationsList", visibility=["read", "create", "update", "delete", "query"] ) - """Target repository specified in docker pull command. Eg: docker pull - myregistry.azurecr.io/{targetRepository}:{tag}.""" - creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") - """The creation date of the cache rule.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] + """The list of notifications subscription information for the connected registry.""" + garbage_collection: Optional["_models.GarbageCollectionProperties"] = rest_field( + name="garbageCollection", visibility=["read", "create", "update", "delete", "query"] ) - """Provisioning state of the resource. Known values are: \"Creating\", \"Updating\", \"Deleting\", - \"Succeeded\", \"Failed\", and \"Canceled\".""" + """The garbage collection properties of the connected registry.""" @overload def __init__( self, *, - credential_set_resource_id: Optional[str] = None, - additional_authentication_properties: Optional["_models.AdditionalAuthenticationProperties"] = None, - source_repository: Optional[str] = None, - target_repository: Optional[str] = None, + sync_properties: Optional["_models.SyncUpdateProperties"] = None, + logging: Optional["_models.LoggingProperties"] = None, + client_token_ids: Optional[list[str]] = None, + notifications_list: Optional[list[str]] = None, + garbage_collection: Optional["_models.GarbageCollectionProperties"] = None, ) -> None: ... @overload @@ -753,32 +722,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CacheRuleUpdateParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The parameters for updating a cache rule. +class CredentialHealth(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The health of the auth credential. - :ivar properties: The properties of the cache rule update parameters. - :vartype properties: ~azure.mgmt.containerregistry.models.CacheRuleUpdateProperties - :ivar identity: The identity of the cache rule. - :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties + :ivar status: The health status of credential. Known values are: "Healthy" and "Unhealthy". + :vartype status: str or ~azure.mgmt.containerregistry.models.CredentialHealthStatus + :ivar error_code: Error code representing the health check error. + :vartype error_code: str + :ivar error_message: Descriptive message representing the health check error. + :vartype error_message: str """ - properties: Optional["_models.CacheRuleUpdateProperties"] = rest_field( + status: Optional[Union[str, "_models.CredentialHealthStatus"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The properties of the cache rule update parameters.""" - identity: Optional["_models.IdentityProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """The health status of credential. Known values are: \"Healthy\" and \"Unhealthy\".""" + error_code: Optional[str] = rest_field(name="errorCode", visibility=["read", "create", "update", "delete", "query"]) + """Error code representing the health check error.""" + error_message: Optional[str] = rest_field( + name="errorMessage", visibility=["read", "create", "update", "delete", "query"] ) - """The identity of the cache rule.""" - - __flattened_items = ["credential_set_resource_id", "additional_authentication_properties"] + """Descriptive message representing the health check error.""" @overload def __init__( self, *, - properties: Optional["_models.CacheRuleUpdateProperties"] = None, - identity: Optional["_models.IdentityProperties"] = None, + status: Optional[Union[str, "_models.CredentialHealthStatus"]] = None, + error_code: Optional[str] = None, + error_message: Optional[str] = None, ) -> None: ... @overload @@ -789,109 +761,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class CacheRuleUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The parameters for updating cache rule properties. - :ivar credential_set_resource_id: The ARM resource ID of the credential store which is - associated with the Cache rule. - :vartype credential_set_resource_id: str - :ivar additional_authentication_properties: Authentication configuration used by the cache rule - to access the upstream source repository. Omitted fields retain their current values. When - authentication is first configured, all required fields of the selected authentication type - must be supplied. Changing an existing authentication type is not supported. - :vartype additional_authentication_properties: - ~azure.mgmt.containerregistry.models.AdditionalAuthenticationUpdateProperties - """ - credential_set_resource_id: Optional[str] = rest_field( - name="credentialSetResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The ARM resource ID of the credential store which is associated with the Cache rule.""" - additional_authentication_properties: Optional["_models.AdditionalAuthenticationUpdateProperties"] = rest_field( - name="additionalAuthenticationProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Authentication configuration used by the cache rule to access the upstream source repository. - Omitted fields retain their current values. When authentication is first configured, all - required fields of the selected authentication type must be supplied. Changing an existing - authentication type is not supported.""" - - @overload - def __init__( - self, - *, - credential_set_resource_id: Optional[str] = None, - additional_authentication_properties: Optional["_models.AdditionalAuthenticationUpdateProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CallbackConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The configuration of service URI and custom headers for the webhook. - - :ivar service_uri: The service URI for the webhook to post notifications. Required. - :vartype service_uri: str - :ivar custom_headers: Custom headers that will be added to the webhook notifications. - :vartype custom_headers: dict[str, str] - """ - - service_uri: str = rest_field(name="serviceUri", visibility=["read", "create", "update", "delete", "query"]) - """The service URI for the webhook to post notifications. Required.""" - custom_headers: Optional[dict[str, str]] = rest_field( - name="customHeaders", visibility=["read", "create", "update", "delete", "query"] - ) - """Custom headers that will be added to the webhook notifications.""" - - @overload - def __init__( - self, - *, - service_uri: str, - custom_headers: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ConnectedRegistry(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An object that represents a connected registry for a container registry. +class CredentialSet(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """An object that represents a credential set resource for a container registry. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -904,47 +778,30 @@ class ConnectedRegistry(ProxyResource): # pylint: disable=docstring-keyword-sho :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.containerregistry.models.SystemData - :ivar properties: The properties of the connected registry. - :vartype properties: ~azure.mgmt.containerregistry.models.ConnectedRegistryProperties - :ivar identity: The user-assigned managed identity used by the on-prem connected registry to - authenticate with the cloud registry for sync operations. Requires authType to be - ManagedIdentity. - :vartype identity: ~azure.mgmt.containerregistry.models.ManagedServiceIdentity + :ivar properties: The properties of the credential set. + :vartype properties: ~azure.mgmt.containerregistry.models.CredentialSetProperties + :ivar identity: Identities associated with the resource. This is used to access the KeyVault + secrets. + :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties """ - properties: Optional["_models.ConnectedRegistryProperties"] = rest_field( + properties: Optional["_models.CredentialSetProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The properties of the connected registry.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + """The properties of the credential set.""" + identity: Optional["_models.IdentityProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The user-assigned managed identity used by the on-prem connected registry to authenticate with - the cloud registry for sync operations. Requires authType to be ManagedIdentity.""" + """Identities associated with the resource. This is used to access the KeyVault secrets.""" - __flattened_items = [ - "provisioning_state", - "mode", - "version", - "connection_state", - "last_activity_time", - "activation", - "parent", - "client_token_ids", - "login_server", - "logging", - "status_details", - "notifications_list", - "garbage_collection", - "registry_sync_result", - ] + __flattened_items = ["login_server", "auth_credentials", "creation_date", "provisioning_state"] @overload def __init__( self, *, - properties: Optional["_models.ConnectedRegistryProperties"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, + properties: Optional["_models.CredentialSetProperties"] = None, + identity: Optional["_models.IdentityProperties"] = None, ) -> None: ... @overload @@ -976,111 +833,44 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class ConnectedRegistryProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of a connected registry. +class CredentialSetProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of a credential set resource. + :ivar login_server: The credentials are stored for this upstream or login server. + :vartype login_server: str + :ivar auth_credentials: List of authentication credentials stored for an upstream. Usually + consists of a primary and an optional secondary credential. + :vartype auth_credentials: list[~azure.mgmt.containerregistry.models.AuthCredential] + :ivar creation_date: The creation date of credential store resource. + :vartype creation_date: ~datetime.datetime :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState - :ivar mode: The mode of the connected registry resource that indicates the permissions of the - registry. Required. Known values are: "ReadWrite", "ReadOnly", "Registry", and "Mirror". - :vartype mode: str or ~azure.mgmt.containerregistry.models.ConnectedRegistryMode - :ivar version: The current version of ACR runtime on the connected registry. - :vartype version: str - :ivar connection_state: The current connection state of the connected registry. Known values - are: "Online", "Offline", "Syncing", and "Unhealthy". - :vartype connection_state: str or ~azure.mgmt.containerregistry.models.ConnectionState - :ivar last_activity_time: The last activity time of the connected registry. - :vartype last_activity_time: ~datetime.datetime - :ivar activation: The activation properties of the connected registry. - :vartype activation: ~azure.mgmt.containerregistry.models.ActivationProperties - :ivar parent: The parent of the connected registry. Required. - :vartype parent: ~azure.mgmt.containerregistry.models.ParentProperties - :ivar client_token_ids: The list of the ACR token resource IDs used to authenticate clients to - the connected registry. - :vartype client_token_ids: list[str] - :ivar login_server: The login server properties of the connected registry. - :vartype login_server: ~azure.mgmt.containerregistry.models.LoginServerProperties - :ivar logging: The logging properties of the connected registry. - :vartype logging: ~azure.mgmt.containerregistry.models.LoggingProperties - :ivar status_details: The list of current statuses of the connected registry. - :vartype status_details: list[~azure.mgmt.containerregistry.models.StatusDetailProperties] - :ivar notifications_list: The list of notifications subscription information for the connected - registry. - :vartype notifications_list: list[str] - :ivar garbage_collection: The garbage collection properties of the connected registry. - :vartype garbage_collection: ~azure.mgmt.containerregistry.models.GarbageCollectionProperties - :ivar registry_sync_result: The result of the connected registry's most recent sync with its - parent. - :vartype registry_sync_result: ~azure.mgmt.containerregistry.models.RegistrySyncResult """ + login_server: Optional[str] = rest_field( + name="loginServer", visibility=["read", "create", "update", "delete", "query"] + ) + """The credentials are stored for this upstream or login server.""" + auth_credentials: Optional[list["_models.AuthCredential"]] = rest_field( + name="authCredentials", visibility=["read", "create", "update", "delete", "query"] + ) + """List of authentication credentials stored for an upstream. Usually consists of a primary and an + optional secondary credential.""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """The creation date of credential store resource.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) """Provisioning state of the resource. Known values are: \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - mode: Union[str, "_models.ConnectedRegistryMode"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The mode of the connected registry resource that indicates the permissions of the registry. - Required. Known values are: \"ReadWrite\", \"ReadOnly\", \"Registry\", and \"Mirror\".""" - version: Optional[str] = rest_field(visibility=["read"]) - """The current version of ACR runtime on the connected registry.""" - connection_state: Optional[Union[str, "_models.ConnectionState"]] = rest_field( - name="connectionState", visibility=["read"] - ) - """The current connection state of the connected registry. Known values are: \"Online\", - \"Offline\", \"Syncing\", and \"Unhealthy\".""" - last_activity_time: Optional[datetime.datetime] = rest_field( - name="lastActivityTime", visibility=["read"], format="rfc3339" - ) - """The last activity time of the connected registry.""" - activation: Optional["_models.ActivationProperties"] = rest_field(visibility=["read"]) - """The activation properties of the connected registry.""" - parent: "_models.ParentProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The parent of the connected registry. Required.""" - client_token_ids: Optional[list[str]] = rest_field( - name="clientTokenIds", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of the ACR token resource IDs used to authenticate clients to the connected registry.""" - login_server: Optional["_models.LoginServerProperties"] = rest_field( - name="loginServer", visibility=["read", "create", "update", "delete", "query"] - ) - """The login server properties of the connected registry.""" - logging: Optional["_models.LoggingProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The logging properties of the connected registry.""" - status_details: Optional[list["_models.StatusDetailProperties"]] = rest_field( - name="statusDetails", visibility=["read"] - ) - """The list of current statuses of the connected registry.""" - notifications_list: Optional[list[str]] = rest_field( - name="notificationsList", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of notifications subscription information for the connected registry.""" - garbage_collection: Optional["_models.GarbageCollectionProperties"] = rest_field( - name="garbageCollection", visibility=["read", "create", "update", "delete", "query"] - ) - """The garbage collection properties of the connected registry.""" - registry_sync_result: Optional["_models.RegistrySyncResult"] = rest_field( - name="registrySyncResult", visibility=["read", "create", "update", "delete", "query"] - ) - """The result of the connected registry's most recent sync with its parent.""" @overload def __init__( self, *, - mode: Union[str, "_models.ConnectedRegistryMode"], - parent: "_models.ParentProperties", - client_token_ids: Optional[list[str]] = None, - login_server: Optional["_models.LoginServerProperties"] = None, - logging: Optional["_models.LoggingProperties"] = None, - notifications_list: Optional[list[str]] = None, - garbage_collection: Optional["_models.GarbageCollectionProperties"] = None, - registry_sync_result: Optional["_models.RegistrySyncResult"] = None, + login_server: Optional[str] = None, + auth_credentials: Optional[list["_models.AuthCredential"]] = None, ) -> None: ... @overload @@ -1094,34 +884,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConnectedRegistryUpdateParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The parameters for updating a connected registry. +class CredentialSetUpdateParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The parameters for updating a credential set. - :ivar properties: The properties of the connected registry update parameters. - :vartype properties: ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateProperties - :ivar identity: The user-assigned managed identity used to authenticate the connected registry - with its parent during synchronization. Requires authType to be ManagedIdentity. - :vartype identity: ~azure.mgmt.containerregistry.models.ManagedServiceIdentity + :ivar properties: The properties of the credential set update parameters. + :vartype properties: ~azure.mgmt.containerregistry.models.CredentialSetUpdateProperties + :ivar identity: Identities associated with the resource. This is used to access the KeyVault + secrets. + :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties """ - properties: Optional["_models.ConnectedRegistryUpdateProperties"] = rest_field( + properties: Optional["_models.CredentialSetUpdateProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The properties of the connected registry update parameters.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + """The properties of the credential set update parameters.""" + identity: Optional["_models.IdentityProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The user-assigned managed identity used to authenticate the connected registry with its parent - during synchronization. Requires authType to be ManagedIdentity.""" + """Identities associated with the resource. This is used to access the KeyVault secrets.""" - __flattened_items = ["sync_properties", "logging", "client_token_ids", "notifications_list", "garbage_collection"] + __flattened_items = ["auth_credentials"] @overload def __init__( self, *, - properties: Optional["_models.ConnectedRegistryUpdateProperties"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, + properties: Optional["_models.CredentialSetUpdateProperties"] = None, + identity: Optional["_models.IdentityProperties"] = None, ) -> None: ... @overload @@ -1153,53 +942,25 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class ConnectedRegistryUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The parameters for updating token properties. +class CredentialSetUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The parameters for updating credential set properties. - :ivar sync_properties: The sync properties of the connected registry with its parent. - :vartype sync_properties: ~azure.mgmt.containerregistry.models.SyncUpdateProperties - :ivar logging: The logging properties of the connected registry. - :vartype logging: ~azure.mgmt.containerregistry.models.LoggingProperties - :ivar client_token_ids: The list of the ACR token resource IDs used to authenticate clients to - the connected registry. - :vartype client_token_ids: list[str] - :ivar notifications_list: The list of notifications subscription information for the connected - registry. - :vartype notifications_list: list[str] - :ivar garbage_collection: The garbage collection properties of the connected registry. - :vartype garbage_collection: ~azure.mgmt.containerregistry.models.GarbageCollectionProperties + :ivar auth_credentials: List of authentication credentials stored for an upstream. Usually + consists of a primary and an optional secondary credential. + :vartype auth_credentials: list[~azure.mgmt.containerregistry.models.AuthCredential] """ - sync_properties: Optional["_models.SyncUpdateProperties"] = rest_field( - name="syncProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """The sync properties of the connected registry with its parent.""" - logging: Optional["_models.LoggingProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The logging properties of the connected registry.""" - client_token_ids: Optional[list[str]] = rest_field( - name="clientTokenIds", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of the ACR token resource IDs used to authenticate clients to the connected registry.""" - notifications_list: Optional[list[str]] = rest_field( - name="notificationsList", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of notifications subscription information for the connected registry.""" - garbage_collection: Optional["_models.GarbageCollectionProperties"] = rest_field( - name="garbageCollection", visibility=["read", "create", "update", "delete", "query"] + auth_credentials: Optional[list["_models.AuthCredential"]] = rest_field( + name="authCredentials", visibility=["read", "create", "update", "delete", "query"] ) - """The garbage collection properties of the connected registry.""" - + """List of authentication credentials stored for an upstream. Usually consists of a primary and an + optional secondary credential.""" + @overload def __init__( self, *, - sync_properties: Optional["_models.SyncUpdateProperties"] = None, - logging: Optional["_models.LoggingProperties"] = None, - client_token_ids: Optional[list[str]] = None, - notifications_list: Optional[list[str]] = None, - garbage_collection: Optional["_models.GarbageCollectionProperties"] = None, + auth_credentials: Optional[list["_models.AuthCredential"]] = None, ) -> None: ... @overload @@ -1213,35 +974,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CredentialHealth(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The health of the auth credential. +class EncryptionProperty(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """EncryptionProperty. - :ivar status: The health status of credential. Known values are: "Healthy" and "Unhealthy". - :vartype status: str or ~azure.mgmt.containerregistry.models.CredentialHealthStatus - :ivar error_code: Error code representing the health check error. - :vartype error_code: str - :ivar error_message: Descriptive message representing the health check error. - :vartype error_message: str + :ivar status: Indicates whether or not the encryption is enabled for container registry. Known + values are: "enabled" and "disabled". + :vartype status: str or ~azure.mgmt.containerregistry.models.EncryptionStatus + :ivar key_vault_properties: Key vault properties. + :vartype key_vault_properties: ~azure.mgmt.containerregistry.models.KeyVaultProperties """ - status: Optional[Union[str, "_models.CredentialHealthStatus"]] = rest_field( + status: Optional[Union[str, "_models.EncryptionStatus"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The health status of credential. Known values are: \"Healthy\" and \"Unhealthy\".""" - error_code: Optional[str] = rest_field(name="errorCode", visibility=["read", "create", "update", "delete", "query"]) - """Error code representing the health check error.""" - error_message: Optional[str] = rest_field( - name="errorMessage", visibility=["read", "create", "update", "delete", "query"] + """Indicates whether or not the encryption is enabled for container registry. Known values are: + \"enabled\" and \"disabled\".""" + key_vault_properties: Optional["_models.KeyVaultProperties"] = rest_field( + name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"] ) - """Descriptive message representing the health check error.""" + """Key vault properties.""" @overload def __init__( self, *, - status: Optional[Union[str, "_models.CredentialHealthStatus"]] = None, - error_code: Optional[str] = None, - error_message: Optional[str] = None, + status: Optional[Union[str, "_models.EncryptionStatus"]] = None, + key_vault_properties: Optional["_models.KeyVaultProperties"] = None, ) -> None: ... @overload @@ -1255,113 +1013,65 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CredentialSet(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An object that represents a credential set resource for a container registry. +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the private link resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The additional info type. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.containerregistry.models.SystemData - :ivar properties: The properties of the credential set. - :vartype properties: ~azure.mgmt.containerregistry.models.CredentialSetProperties - :ivar identity: Identities associated with the resource. This is used to access the KeyVault - secrets. - :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties + :ivar info: The additional info. + :vartype info: any """ - properties: Optional["_models.CredentialSetProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties of the credential set.""" - identity: Optional["_models.IdentityProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Identities associated with the resource. This is used to access the KeyVault secrets.""" - - __flattened_items = ["login_server", "auth_credentials", "creation_date", "provisioning_state"] - - @overload - def __init__( - self, - *, - properties: Optional["_models.CredentialSetProperties"] = None, - identity: Optional["_models.IdentityProperties"] = None, - ) -> None: ... + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) +class ErrorDetail(_Model): + """The error detail. - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.containerregistry.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.containerregistry.models.ErrorAdditionalInfo] + """ - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" -class CredentialSetProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of a credential set resource. +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response. - :ivar login_server: The credentials are stored for this upstream or login server. - :vartype login_server: str - :ivar auth_credentials: List of authentication credentials stored for an upstream. Usually - consists of a primary and an optional secondary credential. - :vartype auth_credentials: list[~azure.mgmt.containerregistry.models.AuthCredential] - :ivar creation_date: The creation date of credential store resource. - :vartype creation_date: ~datetime.datetime - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating", - "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState + :ivar error: The error object. + :vartype error: ~azure.mgmt.containerregistry.models.ErrorDetail """ - login_server: Optional[str] = rest_field( - name="loginServer", visibility=["read", "create", "update", "delete", "query"] - ) - """The credentials are stored for this upstream or login server.""" - auth_credentials: Optional[list["_models.AuthCredential"]] = rest_field( - name="authCredentials", visibility=["read", "create", "update", "delete", "query"] - ) - """List of authentication credentials stored for an upstream. Usually consists of a primary and an - optional secondary credential.""" - creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") - """The creation date of credential store resource.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state of the resource. Known values are: \"Creating\", \"Updating\", \"Deleting\", - \"Succeeded\", \"Failed\", and \"Canceled\".""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" @overload def __init__( self, *, - login_server: Optional[str] = None, - auth_credentials: Optional[list["_models.AuthCredential"]] = None, + error: Optional["_models.ErrorDetail"] = None, ) -> None: ... @overload @@ -1375,33 +1085,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CredentialSetUpdateParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The parameters for updating a credential set. +class EventInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The basic information of an event. - :ivar properties: The properties of the credential set update parameters. - :vartype properties: ~azure.mgmt.containerregistry.models.CredentialSetUpdateProperties - :ivar identity: Identities associated with the resource. This is used to access the KeyVault - secrets. - :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties + :ivar id: The event ID. + :vartype id: str """ - properties: Optional["_models.CredentialSetUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties of the credential set update parameters.""" - identity: Optional["_models.IdentityProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Identities associated with the resource. This is used to access the KeyVault secrets.""" - - __flattened_items = ["auth_credentials"] + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event ID.""" @overload def __init__( self, *, - properties: Optional["_models.CredentialSetUpdateProperties"] = None, - identity: Optional["_models.IdentityProperties"] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -1412,46 +1110,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) -class CredentialSetUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The parameters for updating credential set properties. +class Event(EventInfo): # pylint: disable=docstring-keyword-should-match-keyword-only + """The event for a webhook. - :ivar auth_credentials: List of authentication credentials stored for an upstream. Usually - consists of a primary and an optional secondary credential. - :vartype auth_credentials: list[~azure.mgmt.containerregistry.models.AuthCredential] + :ivar id: The event ID. + :vartype id: str + :ivar event_request_message: The event request message sent to the service URI. + :vartype event_request_message: ~azure.mgmt.containerregistry.models.EventRequestMessage + :ivar event_response_message: The event response message received from the service URI. + :vartype event_response_message: ~azure.mgmt.containerregistry.models.EventResponseMessage """ - auth_credentials: Optional[list["_models.AuthCredential"]] = rest_field( - name="authCredentials", visibility=["read", "create", "update", "delete", "query"] + event_request_message: Optional["_models.EventRequestMessage"] = rest_field( + name="eventRequestMessage", visibility=["read", "create", "update", "delete", "query"] ) - """List of authentication credentials stored for an upstream. Usually consists of a primary and an - optional secondary credential.""" + """The event request message sent to the service URI.""" + event_response_message: Optional["_models.EventResponseMessage"] = rest_field( + name="eventResponseMessage", visibility=["read", "create", "update", "delete", "query"] + ) + """The event response message received from the service URI.""" @overload def __init__( self, *, - auth_credentials: Optional[list["_models.AuthCredential"]] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + event_request_message: Optional["_models.EventRequestMessage"] = None, + event_response_message: Optional["_models.EventResponseMessage"] = None, ) -> None: ... @overload @@ -1465,467 +1153,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EcrAuthenticationProperties( - AdditionalAuthenticationProperties, discriminator="AwsElasticContainerRegistry" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Amazon Elastic Container Registry (ECR) authentication configuration. - - :ivar authentication_type: Required. Amazon Elastic Container Registry (ECR) authentication via - workload identity federation. - :vartype authentication_type: str or - ~azure.mgmt.containerregistry.models.AdditionalAuthenticationType - :ivar account_number: The AWS account that owns the IAM role used for authentication. The IAM - role is assumed via AWS Security Token Service (STS) when exchanging a federated Entra access - token for an ECR access token. The full IAM role ARN is derived from ``accountNumber``, - ``rolePath``, and ``roleName`` as ``arn:aws:iam::{accountNumber}:role{rolePath}{roleName}`` - (the initial path defaults to ``/``). Required. - :vartype account_number: str - :ivar region: The AWS region of the upstream Elastic Container Registry (e.g. ``us-west-2``). - Only commercial AWS regions are supported; the GovCloud (``us-gov-*``), China (``cn-*``), and - Secret/Top Secret ISO (``us-iso*``) partitions are rejected. The pattern stays - forward-compatible for new commercial regions without requiring a contract change. Required. - :vartype region: str - :ivar role_name: The name of the AWS IAM role assumed for authentication. This is the role name - only, not the full ARN; the IAM path is supplied separately via ``rolePath``, so '/' is not - permitted here. Required. - :vartype role_name: str - :ivar role_path: Optional IAM path of the role (for example ``/team/`` or ``/division/team/``). - The value must be supplied in canonical form with a leading and trailing '/'; it is validated - as-is and is never normalized. A non-root path must contain at least one character between the - surrounding slashes. When authentication is first configured, an omitted path defaults to the - root (``/``). When updating an existing authentication configuration, an omitted path retains - its current value. - :vartype role_path: str - """ - - authentication_type: Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY] = rest_discriminator(name="authenticationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Amazon Elastic Container Registry (ECR) authentication via workload identity - federation.""" - account_number: str = rest_field(name="accountNumber", visibility=["read", "create", "update", "delete", "query"]) - """The AWS account that owns the IAM role used for authentication. The IAM role is assumed via AWS - Security Token Service (STS) when exchanging a federated Entra access token for an ECR access - token. The full IAM role ARN is derived from ``accountNumber``, ``rolePath``, and ``roleName`` - as ``arn:aws:iam::{accountNumber}:role{rolePath}{roleName}`` (the initial path defaults to - ``/``). Required.""" - region: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The AWS region of the upstream Elastic Container Registry (e.g. ``us-west-2``). Only commercial - AWS regions are supported; the GovCloud (``us-gov-*``), China (``cn-*``), and Secret/Top Secret - ISO (``us-iso*``) partitions are rejected. The pattern stays forward-compatible for new - commercial regions without requiring a contract change. Required.""" - role_name: str = rest_field(name="roleName", visibility=["read", "create", "update", "delete", "query"]) - """The name of the AWS IAM role assumed for authentication. This is the role name only, not the - full ARN; the IAM path is supplied separately via ``rolePath``, so '/' is not permitted here. - Required.""" - role_path: Optional[str] = rest_field(name="rolePath", visibility=["read", "create", "update", "delete", "query"]) - """Optional IAM path of the role (for example ``/team/`` or ``/division/team/``). The value must - be supplied in canonical form with a leading and trailing '/'; it is validated as-is and is - never normalized. A non-root path must contain at least one character between the surrounding - slashes. When authentication is first configured, an omitted path defaults to the root (``/``). - When updating an existing authentication configuration, an omitted path retains its current - value.""" - - @overload - def __init__( - self, - *, - account_number: str, - region: str, - role_name: str, - role_path: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.authentication_type = AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY # type: ignore - - -class EcrAuthenticationUpdateProperties( - AdditionalAuthenticationUpdateProperties, discriminator="AwsElasticContainerRegistry" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Partial Amazon Elastic Container Registry (ECR) authentication configuration. When - authentication is first configured, accountNumber, region, and roleName must be supplied. - - :ivar authentication_type: Required. Amazon Elastic Container Registry (ECR) authentication via - workload identity federation. - :vartype authentication_type: str or - ~azure.mgmt.containerregistry.models.AdditionalAuthenticationType - :ivar account_number: The AWS account that owns the IAM role used for authentication. The IAM - role is assumed via AWS Security Token Service (STS) when exchanging a federated Entra access - token for an ECR access token. The full IAM role ARN is derived from ``accountNumber``, - ``rolePath``, and ``roleName`` as ``arn:aws:iam::{accountNumber}:role{rolePath}{roleName}`` - (the initial path defaults to ``/``). - :vartype account_number: str - :ivar region: The AWS region of the upstream Elastic Container Registry (e.g. ``us-west-2``). - Only commercial AWS regions are supported; the GovCloud (``us-gov-*``), China (``cn-*``), and - Secret/Top Secret ISO (``us-iso*``) partitions are rejected. The pattern stays - forward-compatible for new commercial regions without requiring a contract change. - :vartype region: str - :ivar role_name: The name of the AWS IAM role assumed for authentication. This is the role name - only, not the full ARN; the IAM path is supplied separately via ``rolePath``, so '/' is not - permitted here. - :vartype role_name: str - :ivar role_path: Optional IAM path of the role (for example ``/team/`` or ``/division/team/``). - The value must be supplied in canonical form with a leading and trailing '/'; it is validated - as-is and is never normalized. A non-root path must contain at least one character between the - surrounding slashes. When authentication is first configured, an omitted path defaults to the - root (``/``). When updating an existing authentication configuration, an omitted path retains - its current value. - :vartype role_path: str - """ - - authentication_type: Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY] = rest_discriminator(name="authenticationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Amazon Elastic Container Registry (ECR) authentication via workload identity - federation.""" - account_number: Optional[str] = rest_field( - name="accountNumber", visibility=["read", "create", "update", "delete", "query"] - ) - """The AWS account that owns the IAM role used for authentication. The IAM role is assumed via AWS - Security Token Service (STS) when exchanging a federated Entra access token for an ECR access - token. The full IAM role ARN is derived from ``accountNumber``, ``rolePath``, and ``roleName`` - as ``arn:aws:iam::{accountNumber}:role{rolePath}{roleName}`` (the initial path defaults to - ``/``).""" - region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The AWS region of the upstream Elastic Container Registry (e.g. ``us-west-2``). Only commercial - AWS regions are supported; the GovCloud (``us-gov-*``), China (``cn-*``), and Secret/Top Secret - ISO (``us-iso*``) partitions are rejected. The pattern stays forward-compatible for new - commercial regions without requiring a contract change.""" - role_name: Optional[str] = rest_field(name="roleName", visibility=["read", "create", "update", "delete", "query"]) - """The name of the AWS IAM role assumed for authentication. This is the role name only, not the - full ARN; the IAM path is supplied separately via ``rolePath``, so '/' is not permitted here.""" - role_path: Optional[str] = rest_field(name="rolePath", visibility=["read", "create", "update", "delete", "query"]) - """Optional IAM path of the role (for example ``/team/`` or ``/division/team/``). The value must - be supplied in canonical form with a leading and trailing '/'; it is validated as-is and is - never normalized. A non-root path must contain at least one character between the surrounding - slashes. When authentication is first configured, an omitted path defaults to the root (``/``). - When updating an existing authentication configuration, an omitted path retains its current - value.""" - - @overload - def __init__( - self, - *, - account_number: Optional[str] = None, - region: Optional[str] = None, - role_name: Optional[str] = None, - role_path: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.authentication_type = AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY # type: ignore - - -class EncryptionProperty(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """EncryptionProperty. - - :ivar status: Indicates whether or not the encryption is enabled for container registry. Known - values are: "enabled" and "disabled". - :vartype status: str or ~azure.mgmt.containerregistry.models.EncryptionStatus - :ivar key_vault_properties: Key vault properties. - :vartype key_vault_properties: ~azure.mgmt.containerregistry.models.KeyVaultProperties - """ - - status: Optional[Union[str, "_models.EncryptionStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates whether or not the encryption is enabled for container registry. Known values are: - \"enabled\" and \"disabled\".""" - key_vault_properties: Optional["_models.KeyVaultProperties"] = rest_field( - name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Key vault properties.""" - - @overload - def __init__( - self, - *, - status: Optional[Union[str, "_models.EncryptionStatus"]] = None, - key_vault_properties: Optional["_models.KeyVaultProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EntraFederatedIdentityCredentialAuthenticationProperties( - AdditionalAuthenticationProperties, discriminator="EntraFederatedIdentityCredential" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Microsoft Entra federated identity credential authentication configuration. - - :ivar authentication_type: Required. Microsoft Entra authentication via a federated identity - credential on an application in another tenant. - :vartype authentication_type: str or - ~azure.mgmt.containerregistry.models.AdditionalAuthenticationType - :ivar source_tenant_id: The upstream tenant that issues the token for - ``federatedApplicationClientId`` and contains the application's enterprise application (service - principal). Required. - :vartype source_tenant_id: str - :ivar federated_application_client_id: The client ID of the multi-tenant application. Its - application registration and federated identity credential must be in the cache rule managed - identity's home tenant. The credential's subject is the managed identity's principal/object ID, - not its client ID. Its enterprise application (service principal) must exist in - ``sourceTenantId``. Required. - :vartype federated_application_client_id: str - """ - - authentication_type: Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL] = rest_discriminator(name="authenticationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Microsoft Entra authentication via a federated identity credential on an application - in another tenant.""" - source_tenant_id: str = rest_field( - name="sourceTenantId", visibility=["read", "create", "update", "delete", "query"] - ) - """The upstream tenant that issues the token for ``federatedApplicationClientId`` and contains the - application's enterprise application (service principal). Required.""" - federated_application_client_id: str = rest_field( - name="federatedApplicationClientId", visibility=["read", "create", "update", "delete", "query"] - ) - """The client ID of the multi-tenant application. Its application registration and federated - identity credential must be in the cache rule managed identity's home tenant. The credential's - subject is the managed identity's principal/object ID, not its client ID. Its enterprise - application (service principal) must exist in ``sourceTenantId``. Required.""" - - @overload - def __init__( - self, - *, - source_tenant_id: str, - federated_application_client_id: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.authentication_type = AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL # type: ignore - - -class EntraFederatedIdentityCredentialAuthenticationUpdateProperties( - AdditionalAuthenticationUpdateProperties, discriminator="EntraFederatedIdentityCredential" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Partial Microsoft Entra federated identity credential authentication configuration. When - authentication is first configured, sourceTenantId and federatedApplicationClientId must be - supplied. - - :ivar authentication_type: Required. Microsoft Entra authentication via a federated identity - credential on an application in another tenant. - :vartype authentication_type: str or - ~azure.mgmt.containerregistry.models.AdditionalAuthenticationType - :ivar source_tenant_id: The upstream tenant that issues the token for - ``federatedApplicationClientId`` and contains the application's enterprise application (service - principal). - :vartype source_tenant_id: str - :ivar federated_application_client_id: The client ID of the multi-tenant application. Its - application registration and federated identity credential must be in the cache rule managed - identity's home tenant. The credential's subject is the managed identity's principal/object ID, - not its client ID. Its enterprise application (service principal) must exist in - ``sourceTenantId``. - :vartype federated_application_client_id: str - """ - - authentication_type: Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL] = rest_discriminator(name="authenticationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Microsoft Entra authentication via a federated identity credential on an application - in another tenant.""" - source_tenant_id: Optional[str] = rest_field( - name="sourceTenantId", visibility=["read", "create", "update", "delete", "query"] - ) - """The upstream tenant that issues the token for ``federatedApplicationClientId`` and contains the - application's enterprise application (service principal).""" - federated_application_client_id: Optional[str] = rest_field( - name="federatedApplicationClientId", visibility=["read", "create", "update", "delete", "query"] - ) - """The client ID of the multi-tenant application. Its application registration and federated - identity credential must be in the cache rule managed identity's home tenant. The credential's - subject is the managed identity's principal/object ID, not its client ID. Its enterprise - application (service principal) must exist in ``sourceTenantId``.""" - - @overload - def __init__( - self, - *, - source_tenant_id: Optional[str] = None, - federated_application_client_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.authentication_type = AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL # type: ignore - - -class ErrorAdditionalInfo(_Model): - """The resource management error additional info. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - type: Optional[str] = rest_field(visibility=["read"]) - """The additional info type.""" - info: Optional[Any] = rest_field(visibility=["read"]) - """The additional info.""" - - -class ErrorDetail(_Model): - """The error detail. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.containerregistry.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.containerregistry.models.ErrorAdditionalInfo] - """ - - code: Optional[str] = rest_field(visibility=["read"]) - """The error code.""" - message: Optional[str] = rest_field(visibility=["read"]) - """The error message.""" - target: Optional[str] = rest_field(visibility=["read"]) - """The error target.""" - details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) - """The error details.""" - additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( - name="additionalInfo", visibility=["read"] - ) - """The error additional info.""" - - -class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Error response. - - :ivar error: The error object. - :vartype error: ~azure.mgmt.containerregistry.models.ErrorDetail - """ - - error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error object.""" - - @overload - def __init__( - self, - *, - error: Optional["_models.ErrorDetail"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EventInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The basic information of an event. - - :ivar id: The event ID. - :vartype id: str - """ - - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event ID.""" - - @overload - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Event(EventInfo): # pylint: disable=docstring-keyword-should-match-keyword-only - """The event for a webhook. - - :ivar id: The event ID. - :vartype id: str - :ivar event_request_message: The event request message sent to the service URI. - :vartype event_request_message: ~azure.mgmt.containerregistry.models.EventRequestMessage - :ivar event_response_message: The event response message received from the service URI. - :vartype event_response_message: ~azure.mgmt.containerregistry.models.EventResponseMessage - """ - - event_request_message: Optional["_models.EventRequestMessage"] = rest_field( - name="eventRequestMessage", visibility=["read", "create", "update", "delete", "query"] - ) - """The event request message sent to the service URI.""" - event_response_message: Optional["_models.EventResponseMessage"] = rest_field( - name="eventResponseMessage", visibility=["read", "create", "update", "delete", "query"] - ) - """The event response message received from the service URI.""" - - @overload - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - event_request_message: Optional["_models.EventRequestMessage"] = None, - event_response_message: Optional["_models.EventResponseMessage"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EventContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The content of the event request message. +class EventContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The content of the event request message. :ivar id: The event ID. :vartype id: str @@ -2090,184 +1319,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExportPipeline(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An object that represents an export pipeline for a container registry. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the private link resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.containerregistry.models.SystemData - :ivar properties: The properties of the export pipeline. - :vartype properties: ~azure.mgmt.containerregistry.models.ExportPipelineProperties - :ivar location: The location of the export pipeline. - :vartype location: str - :ivar identity: The identity of the export pipeline. - :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties - """ - - properties: Optional["_models.ExportPipelineProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties of the export pipeline.""" - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The location of the export pipeline.""" - identity: Optional["_models.IdentityProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The identity of the export pipeline.""" - - __flattened_items = ["target", "options", "provisioning_state"] - - @overload - def __init__( - self, - *, - properties: Optional["_models.ExportPipelineProperties"] = None, - location: Optional[str] = None, - identity: Optional["_models.IdentityProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class ExportPipelineProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of an export pipeline. - - :ivar target: The target properties of the export pipeline. Required. - :vartype target: ~azure.mgmt.containerregistry.models.ExportPipelineTargetProperties - :ivar options: The list of all options configured for the pipeline. - :vartype options: list[str or ~azure.mgmt.containerregistry.models.PipelineOptions] - :ivar provisioning_state: The provisioning state of the pipeline at the time the operation was - called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and - "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState - """ - - target: "_models.ExportPipelineTargetProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The target properties of the export pipeline. Required.""" - options: Optional[list[Union[str, "_models.PipelineOptions"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The list of all options configured for the pipeline.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The provisioning state of the pipeline at the time the operation was called. Known values are: - \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - - @overload - def __init__( - self, - *, - target: "_models.ExportPipelineTargetProperties", - options: Optional[list[Union[str, "_models.PipelineOptions"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ExportPipelineTargetProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of the export pipeline target. - - :ivar type: The type of target for the export pipeline. - :vartype type: str - :ivar uri: 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 - `_". - :vartype uri: str - :ivar key_vault_uri: They key vault secret uri to obtain the target storage SAS token. - :vartype key_vault_uri: str - :ivar storage_access_mode: The storage access mode used for the customer storage account. Known - values are: "ManagedIdentity" and "SasToken". - :vartype storage_access_mode: str or ~azure.mgmt.containerregistry.models.StorageAccessMode - """ - - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of target for the export pipeline.""" - uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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 - `_\".""" - key_vault_uri: Optional[str] = rest_field( - name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"] - ) - """They key vault secret uri to obtain the target storage SAS token.""" - storage_access_mode: Optional[Union[str, "_models.StorageAccessMode"]] = rest_field( - name="storageAccessMode", visibility=["read", "create", "update", "delete", "query"] - ) - """The storage access mode used for the customer storage account. Known values are: - \"ManagedIdentity\" and \"SasToken\".""" - - @overload - def __init__( - self, - *, - type: Optional[str] = None, - uri: Optional[str] = None, - key_vault_uri: Optional[str] = None, - storage_access_mode: Optional[Union[str, "_models.StorageAccessMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ExportPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The export policy for a container registry. +class ExportPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The export policy for a container registry. :ivar status: The value that indicates whether the policy is enabled or not. Known values are: "enabled" and "disabled". @@ -2298,126 +1351,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GarAuthenticationProperties( - AdditionalAuthenticationProperties, discriminator="GoogleArtifactRegistry" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Google Artifact Registry (GAR) authentication configuration. - - :ivar authentication_type: Required. Google Artifact Registry (GAR) authentication via workload - identity federation. - :vartype authentication_type: str or - ~azure.mgmt.containerregistry.models.AdditionalAuthenticationType - :ivar project_number: The Google Cloud Platform project that is configured for authentication - Permissions should be granted to - principal://iam.googleapis.com/projects/{ProjectNumber}/locations/global/workloadIdentityPools/{WorkloadIdentityPool}/providers/{WorkloadIdentityProvider}/subject/{ManagedIdentityPrincipal}. - Required. - :vartype project_number: str - :ivar workload_identity_pool: The Google Cloud platform workload identity pool used for - authentication. Required. - :vartype workload_identity_pool: str - :ivar workload_identity_provider: The Google Cloud Platform workload identity provider used for - authentication. Required. - :vartype workload_identity_provider: str - """ - - authentication_type: Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY] = rest_discriminator(name="authenticationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Google Artifact Registry (GAR) authentication via workload identity federation.""" - project_number: str = rest_field(name="projectNumber", visibility=["read", "create", "update", "delete", "query"]) - """The Google Cloud Platform project that is configured for authentication Permissions should be - granted to - principal://iam.googleapis.com/projects/{ProjectNumber}/locations/global/workloadIdentityPools/{WorkloadIdentityPool}/providers/{WorkloadIdentityProvider}/subject/{ManagedIdentityPrincipal}. - Required.""" - workload_identity_pool: str = rest_field( - name="workloadIdentityPool", visibility=["read", "create", "update", "delete", "query"] - ) - """The Google Cloud platform workload identity pool used for authentication. Required.""" - workload_identity_provider: str = rest_field( - name="workloadIdentityProvider", visibility=["read", "create", "update", "delete", "query"] - ) - """The Google Cloud Platform workload identity provider used for authentication. Required.""" - - @overload - def __init__( - self, - *, - project_number: str, - workload_identity_pool: str, - workload_identity_provider: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.authentication_type = AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY # type: ignore - - -class GarAuthenticationUpdateProperties( - AdditionalAuthenticationUpdateProperties, discriminator="GoogleArtifactRegistry" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Partial Google Artifact Registry (GAR) authentication configuration. When authentication is - first configured, projectNumber, workloadIdentityPool, and workloadIdentityProvider must be - supplied. - - :ivar authentication_type: Required. Google Artifact Registry (GAR) authentication via workload - identity federation. - :vartype authentication_type: str or - ~azure.mgmt.containerregistry.models.AdditionalAuthenticationType - :ivar project_number: The Google Cloud Platform project that is configured for authentication - Permissions should be granted to - principal://iam.googleapis.com/projects/{ProjectNumber}/locations/global/workloadIdentityPools/{WorkloadIdentityPool}/providers/{WorkloadIdentityProvider}/subject/{ManagedIdentityPrincipal}. - :vartype project_number: str - :ivar workload_identity_pool: The Google Cloud platform workload identity pool used for - authentication. - :vartype workload_identity_pool: str - :ivar workload_identity_provider: The Google Cloud Platform workload identity provider used for - authentication. - :vartype workload_identity_provider: str - """ - - authentication_type: Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY] = rest_discriminator(name="authenticationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Google Artifact Registry (GAR) authentication via workload identity federation.""" - project_number: Optional[str] = rest_field( - name="projectNumber", visibility=["read", "create", "update", "delete", "query"] - ) - """The Google Cloud Platform project that is configured for authentication Permissions should be - granted to - principal://iam.googleapis.com/projects/{ProjectNumber}/locations/global/workloadIdentityPools/{WorkloadIdentityPool}/providers/{WorkloadIdentityProvider}/subject/{ManagedIdentityPrincipal}.""" - workload_identity_pool: Optional[str] = rest_field( - name="workloadIdentityPool", visibility=["read", "create", "update", "delete", "query"] - ) - """The Google Cloud platform workload identity pool used for authentication.""" - workload_identity_provider: Optional[str] = rest_field( - name="workloadIdentityProvider", visibility=["read", "create", "update", "delete", "query"] - ) - """The Google Cloud Platform workload identity provider used for authentication.""" - - @overload - def __init__( - self, - *, - project_number: Optional[str] = None, - workload_identity_pool: Optional[str] = None, - workload_identity_provider: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.authentication_type = AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY # type: ignore - - class GarbageCollectionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The garbage collection properties of the connected registry. @@ -2644,762 +1577,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImportPipeline(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An object that represents an import pipeline for a container registry. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the private link resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.containerregistry.models.SystemData - :ivar properties: The properties of the import pipeline. - :vartype properties: ~azure.mgmt.containerregistry.models.ImportPipelineProperties - :ivar location: The location of the import pipeline. - :vartype location: str - :ivar identity: The identity of the import pipeline. - :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties - """ - - properties: Optional["_models.ImportPipelineProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties of the import pipeline.""" - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The location of the import pipeline.""" - identity: Optional["_models.IdentityProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The identity of the import pipeline.""" - - __flattened_items = ["source", "trigger", "options", "provisioning_state"] - - @overload - def __init__( - self, - *, - properties: Optional["_models.ImportPipelineProperties"] = None, - location: Optional[str] = None, - identity: Optional["_models.IdentityProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class ImportPipelineProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of an import pipeline. - - :ivar source: The source properties of the import pipeline. Required. - :vartype source: ~azure.mgmt.containerregistry.models.ImportPipelineSourceProperties - :ivar trigger: The properties that describe the trigger of the import pipeline. - :vartype trigger: ~azure.mgmt.containerregistry.models.PipelineTriggerProperties - :ivar options: The list of all options configured for the pipeline. - :vartype options: list[str or ~azure.mgmt.containerregistry.models.PipelineOptions] - :ivar provisioning_state: The provisioning state of the pipeline at the time the operation was - called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and - "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState - """ - - source: "_models.ImportPipelineSourceProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The source properties of the import pipeline. Required.""" - trigger: Optional["_models.PipelineTriggerProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties that describe the trigger of the import pipeline.""" - options: Optional[list[Union[str, "_models.PipelineOptions"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The list of all options configured for the pipeline.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The provisioning state of the pipeline at the time the operation was called. Known values are: - \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - - @overload - def __init__( - self, - *, - source: "_models.ImportPipelineSourceProperties", - trigger: Optional["_models.PipelineTriggerProperties"] = None, - options: Optional[list[Union[str, "_models.PipelineOptions"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImportPipelineSourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of the import pipeline source. - - :ivar type: The type of source for the import pipeline. "AzureStorageBlobContainer" - :vartype type: str or ~azure.mgmt.containerregistry.models.PipelineSourceType - :ivar uri: 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 - `_". - :vartype uri: str - :ivar key_vault_uri: They key vault secret uri to obtain the source storage SAS token. - :vartype key_vault_uri: str - :ivar storage_access_mode: The storage access mode used for the customer storage account. Known - values are: "ManagedIdentity" and "SasToken". - :vartype storage_access_mode: str or ~azure.mgmt.containerregistry.models.StorageAccessMode - """ - - type: Optional[Union[str, "_models.PipelineSourceType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of source for the import pipeline. \"AzureStorageBlobContainer\"""" - uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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 - `_\".""" - key_vault_uri: Optional[str] = rest_field( - name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"] - ) - """They key vault secret uri to obtain the source storage SAS token.""" - storage_access_mode: Optional[Union[str, "_models.StorageAccessMode"]] = rest_field( - name="storageAccessMode", visibility=["read", "create", "update", "delete", "query"] - ) - """The storage access mode used for the customer storage account. Known values are: - \"ManagedIdentity\" and \"SasToken\".""" - - @overload - def __init__( - self, - *, - type: Optional[Union[str, "_models.PipelineSourceType"]] = None, - uri: Optional[str] = None, - key_vault_uri: Optional[str] = None, - storage_access_mode: Optional[Union[str, "_models.StorageAccessMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImportSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ImportSource. +class ImportSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ImportSource. :ivar resource_id: The resource identifier of the source Azure Container Registry. :vartype resource_id: str :ivar registry_uri: The address of the source registry (e.g. 'mcr.microsoft.com'). :vartype registry_uri: str :ivar credentials: Credentials used when importing from a registry uri. - :vartype credentials: ~azure.mgmt.containerregistry.models.ImportSourceCredentials - :ivar source_image: 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'). Required. - :vartype source_image: str - """ - - resource_id: Optional[str] = rest_field( - name="resourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The resource identifier of the source Azure Container Registry.""" - registry_uri: Optional[str] = rest_field( - name="registryUri", visibility=["read", "create", "update", "delete", "query"] - ) - """The address of the source registry (e.g. 'mcr.microsoft.com').""" - credentials: Optional["_models.ImportSourceCredentials"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Credentials used when importing from a registry uri.""" - source_image: str = rest_field(name="sourceImage", visibility=["read", "create", "update", "delete", "query"]) - """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'). Required.""" - - @overload - def __init__( - self, - *, - source_image: str, - resource_id: Optional[str] = None, - registry_uri: Optional[str] = None, - credentials: Optional["_models.ImportSourceCredentials"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImportSourceCredentials(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ImportSourceCredentials. - - :ivar username: The username to authenticate with the source registry. - :vartype username: str - :ivar password: The password used to authenticate with the source registry. Required. - :vartype password: str - """ - - username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The username to authenticate with the source registry.""" - password: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The password used to authenticate with the source registry. Required.""" - - @overload - def __init__( - self, - *, - password: str, - username: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class IPRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """IP rule with specific IP or IP range in CIDR format. - - :ivar action: The action of IP ACL rule. "Allow" - :vartype action: str or ~azure.mgmt.containerregistry.models.Action - :ivar ip_address_or_range: Specifies the IP or IP range in CIDR format. Only IPV4 address is - allowed. Required. - :vartype ip_address_or_range: str - """ - - action: Optional[Union[str, "_models.Action"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The action of IP ACL rule. \"Allow\"""" - ip_address_or_range: str = rest_field(name="value", visibility=["read", "create", "update", "delete", "query"]) - """Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. Required.""" - - @overload - def __init__( - self, - *, - ip_address_or_range: str, - action: Optional[Union[str, "_models.Action"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class KeyVaultProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """KeyVaultProperties. - - :ivar key_identifier: Key vault uri to access the encryption key. - :vartype key_identifier: str - :ivar versioned_key_identifier: The fully qualified key identifier that includes the version of - the key that is actually used for encryption. - :vartype versioned_key_identifier: str - :ivar identity: The client id of the identity which will be used to access key vault. - :vartype identity: str - :ivar key_rotation_enabled: Auto key rotation status for a CMK enabled registry. - :vartype key_rotation_enabled: bool - :ivar last_key_rotation_timestamp: Timestamp of the last successful key rotation. - :vartype last_key_rotation_timestamp: ~datetime.datetime - """ - - key_identifier: Optional[str] = rest_field( - name="keyIdentifier", visibility=["read", "create", "update", "delete", "query"] - ) - """Key vault uri to access the encryption key.""" - versioned_key_identifier: Optional[str] = rest_field(name="versionedKeyIdentifier", visibility=["read"]) - """The fully qualified key identifier that includes the version of the key that is actually used - for encryption.""" - identity: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The client id of the identity which will be used to access key vault.""" - key_rotation_enabled: Optional[bool] = rest_field(name="keyRotationEnabled", visibility=["read"]) - """Auto key rotation status for a CMK enabled registry.""" - last_key_rotation_timestamp: Optional[datetime.datetime] = rest_field( - name="lastKeyRotationTimestamp", visibility=["read"], format="rfc3339" - ) - """Timestamp of the last successful key rotation.""" - - @overload - def __init__( - self, - *, - key_identifier: Optional[str] = None, - identity: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class LoggingProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The logging properties of the connected registry. - - :ivar log_level: The verbosity of logs persisted on the connected registry. Known values are: - "Debug", "Information", "Warning", "Error", and "None". - :vartype log_level: str or ~azure.mgmt.containerregistry.models.LogLevel - :ivar audit_log_status: Indicates whether audit logs are enabled on the connected registry. - Known values are: "Enabled" and "Disabled". - :vartype audit_log_status: str or ~azure.mgmt.containerregistry.models.AuditLogStatus - """ - - log_level: Optional[Union[str, "_models.LogLevel"]] = rest_field( - name="logLevel", visibility=["read", "create", "update", "delete", "query"] - ) - """The verbosity of logs persisted on the connected registry. Known values are: \"Debug\", - \"Information\", \"Warning\", \"Error\", and \"None\".""" - audit_log_status: Optional[Union[str, "_models.AuditLogStatus"]] = rest_field( - name="auditLogStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates whether audit logs are enabled on the connected registry. Known values are: - \"Enabled\" and \"Disabled\".""" - - @overload - def __init__( - self, - *, - log_level: Optional[Union[str, "_models.LogLevel"]] = None, - audit_log_status: Optional[Union[str, "_models.AuditLogStatus"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class LoginServerProperties(_Model): - """The login server properties of the connected registry. - - :ivar host: The host of the connected registry. Can be FQDN or IP. - :vartype host: str - :ivar tls: The TLS properties of the connected registry login server. - :vartype tls: ~azure.mgmt.containerregistry.models.TlsProperties - """ - - host: Optional[str] = rest_field(visibility=["read"]) - """The host of the connected registry. Can be FQDN or IP.""" - tls: Optional["_models.TlsProperties"] = rest_field(visibility=["read"]) - """The TLS properties of the connected registry login server.""" - - -class ManagedServiceIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Managed service identity (system assigned and/or user assigned identities). - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: The type of managed identity assigned to this resource. Required. Known values are: - "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.containerregistry.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The identities assigned to this resource by the user. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.containerregistry.models.UserAssignedIdentity] - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The service principal ID of the system assigned identity. This property will only be provided - for a system assigned identity.""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) - """The tenant ID of the system assigned identity. This property will only be provided for a system - assigned identity.""" - type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of managed identity assigned to this resource. Required. Known values are: \"None\", - \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( - name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] - ) - """The identities assigned to this resource by the user.""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NetworkRuleSet(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The network rule set for a container registry. - - :ivar default_action: The default action of allow or deny when no other rules match. Required. - Known values are: "Allow" and "Deny". - :vartype default_action: str or ~azure.mgmt.containerregistry.models.DefaultAction - :ivar virtual_network_rules: The virtual network rules. - :vartype virtual_network_rules: list[~azure.mgmt.containerregistry.models.VirtualNetworkRule] - :ivar ip_rules: The IP ACL rules. - :vartype ip_rules: list[~azure.mgmt.containerregistry.models.IPRule] - """ - - default_action: Union[str, "_models.DefaultAction"] = rest_field( - name="defaultAction", visibility=["read", "create", "update", "delete", "query"] - ) - """The default action of allow or deny when no other rules match. Required. Known values are: - \"Allow\" and \"Deny\".""" - virtual_network_rules: Optional[list["_models.VirtualNetworkRule"]] = rest_field( - name="virtualNetworkRules", visibility=["read", "create", "update", "delete", "query"] - ) - """The virtual network rules.""" - ip_rules: Optional[list["_models.IPRule"]] = rest_field( - name="ipRules", visibility=["read", "create", "update", "delete", "query"] - ) - """The IP ACL rules.""" - - @overload - def __init__( - self, - *, - default_action: Union[str, "_models.DefaultAction"], - virtual_network_rules: Optional[list["_models.VirtualNetworkRule"]] = None, - ip_rules: Optional[list["_models.IPRule"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OperationDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The definition of a container registry operation. - - :ivar origin: The origin information of the container registry operation. - :vartype origin: str - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar display: The display information for the container registry operation. - :vartype display: ~azure.mgmt.containerregistry.models.OperationDisplayDefinition - :ivar properties: The properties information for the container registry operation. - :vartype properties: ~azure.mgmt.containerregistry.models.OperationPropertiesDefinition - :ivar is_data_action: 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 - `_. - :vartype is_data_action: bool - """ - - origin: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The origin information of the container registry operation.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Operation name: {provider}/{resource}/{operation}.""" - display: Optional["_models.OperationDisplayDefinition"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The display information for the container registry operation.""" - properties: Optional["_models.OperationPropertiesDefinition"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties information for the container registry operation.""" - is_data_action: Optional[bool] = rest_field( - name="isDataAction", visibility=["read", "create", "update", "delete", "query"] - ) - """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 - `_.""" - - __flattened_items = ["service_specification"] - - @overload - def __init__( - self, - *, - origin: Optional[str] = None, - name: Optional[str] = None, - display: Optional["_models.OperationDisplayDefinition"] = None, - properties: Optional["_models.OperationPropertiesDefinition"] = None, - is_data_action: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class OperationDisplayDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The display information for a container registry operation. - - :ivar provider: The resource provider name: Microsoft.ContainerRegistry. - :vartype provider: str - :ivar resource: The resource on which the operation is performed. - :vartype resource: str - :ivar operation: The operation that users can perform. - :vartype operation: str - :ivar description: The description for the operation. - :vartype description: str - """ - - provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource provider name: Microsoft.ContainerRegistry.""" - resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource on which the operation is performed.""" - operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The operation that users can perform.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description for the operation.""" - - @overload - def __init__( - self, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OperationLogSpecificationDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The definition of Azure Monitoring log. - - :ivar name: Log name. - :vartype name: str - :ivar display_name: Log display name. - :vartype display_name: str - :ivar blob_duration: Log blob duration. - :vartype blob_duration: str - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Log name.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Log display name.""" - blob_duration: Optional[str] = rest_field( - name="blobDuration", visibility=["read", "create", "update", "delete", "query"] - ) - """Log blob duration.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - blob_duration: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OperationMetricSpecificationDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The definition of Azure Monitoring metric. - - :ivar name: Metric name. - :vartype name: str - :ivar display_name: Metric display name. - :vartype display_name: str - :ivar display_description: Metric description. - :vartype display_description: str - :ivar unit: Metric unit. - :vartype unit: str - :ivar aggregation_type: Metric aggregation type. - :vartype aggregation_type: str - :ivar internal_metric_name: Internal metric name. - :vartype internal_metric_name: str - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metric name.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Metric display name.""" - display_description: Optional[str] = rest_field( - name="displayDescription", visibility=["read", "create", "update", "delete", "query"] - ) - """Metric description.""" - unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metric unit.""" - aggregation_type: Optional[str] = rest_field( - name="aggregationType", visibility=["read", "create", "update", "delete", "query"] - ) - """Metric aggregation type.""" - internal_metric_name: Optional[str] = rest_field( - name="internalMetricName", visibility=["read", "create", "update", "delete", "query"] - ) - """Internal metric name.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - display_description: Optional[str] = None, - unit: Optional[str] = None, - aggregation_type: Optional[str] = None, - internal_metric_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OperationPropertiesDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The definition of Azure Monitoring properties. - - :ivar service_specification: The definition of Azure Monitoring service. - :vartype service_specification: - ~azure.mgmt.containerregistry.models.OperationServiceSpecificationDefinition + :vartype credentials: ~azure.mgmt.containerregistry.models.ImportSourceCredentials + :ivar source_image: 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'). Required. + :vartype source_image: str """ - service_specification: Optional["_models.OperationServiceSpecificationDefinition"] = rest_field( - name="serviceSpecification", visibility=["read", "create", "update", "delete", "query"] + resource_id: Optional[str] = rest_field( + name="resourceId", visibility=["read", "create", "update", "delete", "query"] ) - """The definition of Azure Monitoring service.""" + """The resource identifier of the source Azure Container Registry.""" + registry_uri: Optional[str] = rest_field( + name="registryUri", visibility=["read", "create", "update", "delete", "query"] + ) + """The address of the source registry (e.g. 'mcr.microsoft.com').""" + credentials: Optional["_models.ImportSourceCredentials"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Credentials used when importing from a registry uri.""" + source_image: str = rest_field(name="sourceImage", visibility=["read", "create", "update", "delete", "query"]) + """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'). Required.""" @overload def __init__( self, *, - service_specification: Optional["_models.OperationServiceSpecificationDefinition"] = None, + source_image: str, + resource_id: Optional[str] = None, + registry_uri: Optional[str] = None, + credentials: Optional["_models.ImportSourceCredentials"] = None, ) -> None: ... @overload @@ -3413,32 +1631,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OperationServiceSpecificationDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The definition of Azure Monitoring list. +class ImportSourceCredentials(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ImportSourceCredentials. - :ivar metric_specifications: A list of Azure Monitoring metrics definition. - :vartype metric_specifications: - list[~azure.mgmt.containerregistry.models.OperationMetricSpecificationDefinition] - :ivar log_specifications: A list of Azure Monitoring log definitions. - :vartype log_specifications: - list[~azure.mgmt.containerregistry.models.OperationLogSpecificationDefinition] + :ivar username: The username to authenticate with the source registry. + :vartype username: str + :ivar password: The password used to authenticate with the source registry. Required. + :vartype password: str """ - metric_specifications: Optional[list["_models.OperationMetricSpecificationDefinition"]] = rest_field( - name="metricSpecifications", visibility=["read", "create", "update", "delete", "query"] - ) - """A list of Azure Monitoring metrics definition.""" - log_specifications: Optional[list["_models.OperationLogSpecificationDefinition"]] = rest_field( - name="logSpecifications", visibility=["read", "create", "update", "delete", "query"] - ) - """A list of Azure Monitoring log definitions.""" + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The username to authenticate with the source registry.""" + password: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The password used to authenticate with the source registry. Required.""" @overload def __init__( self, *, - metric_specifications: Optional[list["_models.OperationMetricSpecificationDefinition"]] = None, - log_specifications: Optional[list["_models.OperationLogSpecificationDefinition"]] = None, + password: str, + username: Optional[str] = None, ) -> None: ... @overload @@ -3452,28 +1664,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ParentProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of the connected registry parent. +class IPRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """IP rule with specific IP or IP range in CIDR format. - :ivar id: The resource ID of the parent to which the connected registry will be associated. - :vartype id: str - :ivar sync_properties: The sync properties of the connected registry with its parent. Required. - :vartype sync_properties: ~azure.mgmt.containerregistry.models.SyncProperties + :ivar action: The action of IP ACL rule. "Allow" + :vartype action: str or ~azure.mgmt.containerregistry.models.Action + :ivar ip_address_or_range: Specifies the IP or IP range in CIDR format. Only IPV4 address is + allowed. Required. + :vartype ip_address_or_range: str """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource ID of the parent to which the connected registry will be associated.""" - sync_properties: "_models.SyncProperties" = rest_field( - name="syncProperties", visibility=["read", "create", "update", "delete", "query"] + action: Optional[Union[str, "_models.Action"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The sync properties of the connected registry with its parent. Required.""" + """The action of IP ACL rule. \"Allow\"""" + ip_address_or_range: str = rest_field(name="value", visibility=["read", "create", "update", "delete", "query"]) + """Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. Required.""" @overload def __init__( self, *, - sync_properties: "_models.SyncProperties", - id: Optional[str] = None, # pylint: disable=redefined-builtin + ip_address_or_range: str, + action: Optional[Union[str, "_models.Action"]] = None, ) -> None: ... @overload @@ -3487,36 +1700,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PipelineRun(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An object that represents a pipeline run for a container registry. +class KeyVaultProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """KeyVaultProperties. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the private link resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.containerregistry.models.SystemData - :ivar properties: The properties of a pipeline run. - :vartype properties: ~azure.mgmt.containerregistry.models.PipelineRunProperties + :ivar key_identifier: Key vault uri to access the encryption key. + :vartype key_identifier: str + :ivar versioned_key_identifier: The fully qualified key identifier that includes the version of + the key that is actually used for encryption. + :vartype versioned_key_identifier: str + :ivar identity: The client id of the identity which will be used to access key vault. + :vartype identity: str + :ivar key_rotation_enabled: Auto key rotation status for a CMK enabled registry. + :vartype key_rotation_enabled: bool + :ivar last_key_rotation_timestamp: Timestamp of the last successful key rotation. + :vartype last_key_rotation_timestamp: ~datetime.datetime """ - properties: Optional["_models.PipelineRunProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + key_identifier: Optional[str] = rest_field( + name="keyIdentifier", visibility=["read", "create", "update", "delete", "query"] ) - """The properties of a pipeline run.""" - - __flattened_items = ["provisioning_state", "request", "response", "force_update_tag"] + """Key vault uri to access the encryption key.""" + versioned_key_identifier: Optional[str] = rest_field(name="versionedKeyIdentifier", visibility=["read"]) + """The fully qualified key identifier that includes the version of the key that is actually used + for encryption.""" + identity: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The client id of the identity which will be used to access key vault.""" + key_rotation_enabled: Optional[bool] = rest_field(name="keyRotationEnabled", visibility=["read"]) + """Auto key rotation status for a CMK enabled registry.""" + last_key_rotation_timestamp: Optional[datetime.datetime] = rest_field( + name="lastKeyRotationTimestamp", visibility=["read"], format="rfc3339" + ) + """Timestamp of the last successful key rotation.""" @overload def __init__( self, *, - properties: Optional["_models.PipelineRunProperties"] = None, + key_identifier: Optional[str] = None, + identity: Optional[str] = None, ) -> None: ... @overload @@ -3527,65 +1748,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) -class PipelineRunProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of a pipeline run. +class LoggingProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The logging properties of the connected registry. - :ivar provisioning_state: The provisioning state of a pipeline run. Known values are: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState - :ivar request: The request parameters for a pipeline run. - :vartype request: ~azure.mgmt.containerregistry.models.PipelineRunRequest - :ivar response: The response of a pipeline run. - :vartype response: ~azure.mgmt.containerregistry.models.PipelineRunResponse - :ivar force_update_tag: How the pipeline run should be forced to recreate even if the pipeline - run configuration has not changed. - :vartype force_update_tag: str + :ivar log_level: The verbosity of logs persisted on the connected registry. Known values are: + "Debug", "Information", "Warning", "Error", and "None". + :vartype log_level: str or ~azure.mgmt.containerregistry.models.LogLevel + :ivar audit_log_status: Indicates whether audit logs are enabled on the connected registry. + Known values are: "Enabled" and "Disabled". + :vartype audit_log_status: str or ~azure.mgmt.containerregistry.models.AuditLogStatus """ - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The provisioning state of a pipeline run. Known values are: \"Creating\", \"Updating\", - \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - request: Optional["_models.PipelineRunRequest"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + log_level: Optional[Union[str, "_models.LogLevel"]] = rest_field( + name="logLevel", visibility=["read", "create", "update", "delete", "query"] ) - """The request parameters for a pipeline run.""" - response: Optional["_models.PipelineRunResponse"] = rest_field(visibility=["read"]) - """The response of a pipeline run.""" - force_update_tag: Optional[str] = rest_field( - name="forceUpdateTag", visibility=["read", "create", "update", "delete", "query"] + """The verbosity of logs persisted on the connected registry. Known values are: \"Debug\", + \"Information\", \"Warning\", \"Error\", and \"None\".""" + audit_log_status: Optional[Union[str, "_models.AuditLogStatus"]] = rest_field( + name="auditLogStatus", visibility=["read", "create", "update", "delete", "query"] ) - """How the pipeline run should be forced to recreate even if the pipeline run configuration has - not changed.""" + """Indicates whether audit logs are enabled on the connected registry. Known values are: + \"Enabled\" and \"Disabled\".""" @overload def __init__( self, *, - request: Optional["_models.PipelineRunRequest"] = None, - force_update_tag: Optional[str] = None, + log_level: Optional[Union[str, "_models.LogLevel"]] = None, + audit_log_status: Optional[Union[str, "_models.AuditLogStatus"]] = None, ) -> None: ... @overload @@ -3599,55 +1792,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PipelineRunRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The request properties provided for a pipeline run. +class LoginServerProperties(_Model): + """The login server properties of the connected registry. - :ivar pipeline_resource_id: The resource ID of the pipeline to run. - :vartype pipeline_resource_id: str - :ivar artifacts: 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'). - :vartype artifacts: list[str] - :ivar source: The source properties of the pipeline run. - :vartype source: ~azure.mgmt.containerregistry.models.PipelineRunSourceProperties - :ivar target: The target properties of the pipeline run. - :vartype target: ~azure.mgmt.containerregistry.models.PipelineRunTargetProperties - :ivar catalog_digest: The digest of the tar used to transfer the artifacts. - :vartype catalog_digest: str + :ivar host: The host of the connected registry. Can be FQDN or IP. + :vartype host: str + :ivar tls: The TLS properties of the connected registry login server. + :vartype tls: ~azure.mgmt.containerregistry.models.TlsProperties """ - pipeline_resource_id: Optional[str] = rest_field( - name="pipelineResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The resource ID of the pipeline to run.""" - artifacts: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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').""" - source: Optional["_models.PipelineRunSourceProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + host: Optional[str] = rest_field(visibility=["read"]) + """The host of the connected registry. Can be FQDN or IP.""" + tls: Optional["_models.TlsProperties"] = rest_field(visibility=["read"]) + """The TLS properties of the connected registry login server.""" + + +class NetworkRuleSet(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The network rule set for a container registry. + + :ivar default_action: The default action of allow or deny when no other rules match. Required. + Known values are: "Allow" and "Deny". + :vartype default_action: str or ~azure.mgmt.containerregistry.models.DefaultAction + :ivar virtual_network_rules: The virtual network rules. + :vartype virtual_network_rules: list[~azure.mgmt.containerregistry.models.VirtualNetworkRule] + :ivar ip_rules: The IP ACL rules. + :vartype ip_rules: list[~azure.mgmt.containerregistry.models.IPRule] + """ + + default_action: Union[str, "_models.DefaultAction"] = rest_field( + name="defaultAction", visibility=["read", "create", "update", "delete", "query"] ) - """The source properties of the pipeline run.""" - target: Optional["_models.PipelineRunTargetProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """The default action of allow or deny when no other rules match. Required. Known values are: + \"Allow\" and \"Deny\".""" + virtual_network_rules: Optional[list["_models.VirtualNetworkRule"]] = rest_field( + name="virtualNetworkRules", visibility=["read", "create", "update", "delete", "query"] ) - """The target properties of the pipeline run.""" - catalog_digest: Optional[str] = rest_field( - name="catalogDigest", visibility=["read", "create", "update", "delete", "query"] + """The virtual network rules.""" + ip_rules: Optional[list["_models.IPRule"]] = rest_field( + name="ipRules", visibility=["read", "create", "update", "delete", "query"] ) - """The digest of the tar used to transfer the artifacts.""" + """The IP ACL rules.""" @overload def __init__( self, *, - pipeline_resource_id: Optional[str] = None, - artifacts: Optional[list[str]] = None, - source: Optional["_models.PipelineRunSourceProperties"] = None, - target: Optional["_models.PipelineRunTargetProperties"] = None, - catalog_digest: Optional[str] = None, + default_action: Union[str, "_models.DefaultAction"], + virtual_network_rules: Optional[list["_models.VirtualNetworkRule"]] = None, + ip_rules: Optional[list["_models.IPRule"]] = None, ) -> None: ... @overload @@ -3661,85 +1853,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PipelineRunResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The response properties returned for a pipeline run. - - :ivar status: The current status of the pipeline run. - :vartype status: str - :ivar imported_artifacts: The artifacts imported in the pipeline run. - :vartype imported_artifacts: list[str] - :ivar progress: The current progress of the copy operation. - :vartype progress: ~azure.mgmt.containerregistry.models.ProgressProperties - :ivar start_time: The time the pipeline run started. - :vartype start_time: ~datetime.datetime - :ivar finish_time: The time the pipeline run finished. - :vartype finish_time: ~datetime.datetime - :ivar source: The source of the pipeline run. - :vartype source: ~azure.mgmt.containerregistry.models.ImportPipelineSourceProperties - :ivar target: The target of the pipeline run. - :vartype target: ~azure.mgmt.containerregistry.models.ExportPipelineTargetProperties - :ivar catalog_digest: The digest of the tar used to transfer the artifacts. - :vartype catalog_digest: str - :ivar trigger: The trigger that caused the pipeline run. - :vartype trigger: ~azure.mgmt.containerregistry.models.PipelineTriggerDescriptor - :ivar pipeline_run_error_message: The detailed error message for the pipeline run in the case - of failure. - :vartype pipeline_run_error_message: str +class OperationDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The definition of a container registry operation. + + :ivar origin: The origin information of the container registry operation. + :vartype origin: str + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :ivar display: The display information for the container registry operation. + :vartype display: ~azure.mgmt.containerregistry.models.OperationDisplayDefinition + :ivar properties: The properties information for the container registry operation. + :vartype properties: ~azure.mgmt.containerregistry.models.OperationPropertiesDefinition + :ivar is_data_action: 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 + `_. + :vartype is_data_action: bool """ - status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The current status of the pipeline run.""" - imported_artifacts: Optional[list[str]] = rest_field( - name="importedArtifacts", visibility=["read", "create", "update", "delete", "query"] - ) - """The artifacts imported in the pipeline run.""" - progress: Optional["_models.ProgressProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The current progress of the copy operation.""" - start_time: Optional[datetime.datetime] = rest_field( - name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The time the pipeline run started.""" - finish_time: Optional[datetime.datetime] = rest_field( - name="finishTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The time the pipeline run finished.""" - source: Optional["_models.ImportPipelineSourceProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The source of the pipeline run.""" - target: Optional["_models.ExportPipelineTargetProperties"] = rest_field( + origin: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The origin information of the container registry operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation name: {provider}/{resource}/{operation}.""" + display: Optional["_models.OperationDisplayDefinition"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The target of the pipeline run.""" - catalog_digest: Optional[str] = rest_field( - name="catalogDigest", visibility=["read", "create", "update", "delete", "query"] - ) - """The digest of the tar used to transfer the artifacts.""" - trigger: Optional["_models.PipelineTriggerDescriptor"] = rest_field( + """The display information for the container registry operation.""" + properties: Optional["_models.OperationPropertiesDefinition"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The trigger that caused the pipeline run.""" - pipeline_run_error_message: Optional[str] = rest_field( - name="pipelineRunErrorMessage", visibility=["read", "create", "update", "delete", "query"] + """The properties information for the container registry operation.""" + is_data_action: Optional[bool] = rest_field( + name="isDataAction", visibility=["read", "create", "update", "delete", "query"] ) - """The detailed error message for the pipeline run in the case of failure.""" + """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 + `_.""" + + __flattened_items = ["service_specification"] @overload def __init__( self, *, - status: Optional[str] = None, - imported_artifacts: Optional[list[str]] = None, - progress: Optional["_models.ProgressProperties"] = None, - start_time: Optional[datetime.datetime] = None, - finish_time: Optional[datetime.datetime] = None, - source: Optional["_models.ImportPipelineSourceProperties"] = None, - target: Optional["_models.ExportPipelineTargetProperties"] = None, - catalog_digest: Optional[str] = None, - trigger: Optional["_models.PipelineTriggerDescriptor"] = None, - pipeline_run_error_message: Optional[str] = None, + origin: Optional[str] = None, + name: Optional[str] = None, + display: Optional["_models.OperationDisplayDefinition"] = None, + properties: Optional["_models.OperationPropertiesDefinition"] = None, + is_data_action: Optional[bool] = None, ) -> None: ... @overload @@ -3750,31 +1911,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) -class PipelineRunSourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The pipeline run source properties. +class OperationDisplayDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The display information for a container registry operation. - :ivar type: The type of the source. "AzureStorageBlob" - :vartype type: str or ~azure.mgmt.containerregistry.models.PipelineRunSourceType - :ivar name: The name of the source. - :vartype name: str + :ivar provider: The resource provider name: Microsoft.ContainerRegistry. + :vartype provider: str + :ivar resource: The resource on which the operation is performed. + :vartype resource: str + :ivar operation: The operation that users can perform. + :vartype operation: str + :ivar description: The description for the operation. + :vartype description: str """ - type: Optional[Union[str, "_models.PipelineRunSourceType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of the source. \"AzureStorageBlob\"""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the source.""" + provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource provider name: Microsoft.ContainerRegistry.""" + resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource on which the operation is performed.""" + operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The operation that users can perform.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description for the operation.""" @overload def __init__( self, *, - type: Optional[Union[str, "_models.PipelineRunSourceType"]] = None, - name: Optional[str] = None, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, ) -> None: ... @overload @@ -3788,28 +1975,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PipelineRunTargetProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The pipeline run target properties. +class OperationLogSpecificationDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The definition of Azure Monitoring log. - :ivar type: The type of the target. "AzureStorageBlob" - :vartype type: str or ~azure.mgmt.containerregistry.models.PipelineRunTargetType - :ivar name: The name of the target. + :ivar name: Log name. :vartype name: str + :ivar display_name: Log display name. + :vartype display_name: str + :ivar blob_duration: Log blob duration. + :vartype blob_duration: str """ - type: Optional[Union[str, "_models.PipelineRunTargetType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of the target. \"AzureStorageBlob\"""" name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the target.""" + """Log name.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Log display name.""" + blob_duration: Optional[str] = rest_field( + name="blobDuration", visibility=["read", "create", "update", "delete", "query"] + ) + """Log blob duration.""" @overload def __init__( self, *, - type: Optional[Union[str, "_models.PipelineRunTargetType"]] = None, name: Optional[str] = None, + display_name: Optional[str] = None, + blob_duration: Optional[str] = None, ) -> None: ... @overload @@ -3823,23 +2017,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PipelineSourceTriggerDescriptor(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The pipeline source trigger descriptor. +class OperationMetricSpecificationDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The definition of Azure Monitoring metric. - :ivar timestamp: The timestamp when the source update happened. - :vartype timestamp: ~datetime.datetime + :ivar name: Metric name. + :vartype name: str + :ivar display_name: Metric display name. + :vartype display_name: str + :ivar display_description: Metric description. + :vartype display_description: str + :ivar unit: Metric unit. + :vartype unit: str + :ivar aggregation_type: Metric aggregation type. + :vartype aggregation_type: str + :ivar internal_metric_name: Internal metric name. + :vartype internal_metric_name: str """ - timestamp: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Metric name.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Metric display name.""" + display_description: Optional[str] = rest_field( + name="displayDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """Metric description.""" + unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Metric unit.""" + aggregation_type: Optional[str] = rest_field( + name="aggregationType", visibility=["read", "create", "update", "delete", "query"] ) - """The timestamp when the source update happened.""" + """Metric aggregation type.""" + internal_metric_name: Optional[str] = rest_field( + name="internalMetricName", visibility=["read", "create", "update", "delete", "query"] + ) + """Internal metric name.""" @overload def __init__( self, *, - timestamp: Optional[datetime.datetime] = None, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + aggregation_type: Optional[str] = None, + internal_metric_name: Optional[str] = None, ) -> None: ... @overload @@ -3853,23 +2078,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PipelineSourceTriggerProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The source trigger properties of the import pipeline. +class OperationPropertiesDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The definition of Azure Monitoring properties. - :ivar status: The current status of the source trigger. Required. Known values are: "Enabled" - and "Disabled". - :vartype status: str or ~azure.mgmt.containerregistry.models.TriggerStatus + :ivar service_specification: The definition of Azure Monitoring service. + :vartype service_specification: + ~azure.mgmt.containerregistry.models.OperationServiceSpecificationDefinition """ - status: Union[str, "_models.TriggerStatus"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The current status of the source trigger. Required. Known values are: \"Enabled\" and - \"Disabled\".""" + service_specification: Optional["_models.OperationServiceSpecificationDefinition"] = rest_field( + name="serviceSpecification", visibility=["read", "create", "update", "delete", "query"] + ) + """The definition of Azure Monitoring service.""" @overload def __init__( self, *, - status: Union[str, "_models.TriggerStatus"], + service_specification: Optional["_models.OperationServiceSpecificationDefinition"] = None, ) -> None: ... @overload @@ -3883,23 +2109,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PipelineTriggerDescriptor(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The pipeline trigger descriptor. +class OperationServiceSpecificationDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The definition of Azure Monitoring list. - :ivar source_trigger: The source trigger that caused the pipeline run. - :vartype source_trigger: ~azure.mgmt.containerregistry.models.PipelineSourceTriggerDescriptor + :ivar metric_specifications: A list of Azure Monitoring metrics definition. + :vartype metric_specifications: + list[~azure.mgmt.containerregistry.models.OperationMetricSpecificationDefinition] + :ivar log_specifications: A list of Azure Monitoring log definitions. + :vartype log_specifications: + list[~azure.mgmt.containerregistry.models.OperationLogSpecificationDefinition] """ - source_trigger: Optional["_models.PipelineSourceTriggerDescriptor"] = rest_field( - name="sourceTrigger", visibility=["read", "create", "update", "delete", "query"] + metric_specifications: Optional[list["_models.OperationMetricSpecificationDefinition"]] = rest_field( + name="metricSpecifications", visibility=["read", "create", "update", "delete", "query"] + ) + """A list of Azure Monitoring metrics definition.""" + log_specifications: Optional[list["_models.OperationLogSpecificationDefinition"]] = rest_field( + name="logSpecifications", visibility=["read", "create", "update", "delete", "query"] ) - """The source trigger that caused the pipeline run.""" + """A list of Azure Monitoring log definitions.""" @overload def __init__( self, *, - source_trigger: Optional["_models.PipelineSourceTriggerDescriptor"] = None, + metric_specifications: Optional[list["_models.OperationMetricSpecificationDefinition"]] = None, + log_specifications: Optional[list["_models.OperationLogSpecificationDefinition"]] = None, ) -> None: ... @overload @@ -3913,23 +2148,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PipelineTriggerProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The trigger properties of the import pipeline. +class ParentProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of the connected registry parent. - :ivar source_trigger: The source trigger properties of the pipeline. - :vartype source_trigger: ~azure.mgmt.containerregistry.models.PipelineSourceTriggerProperties + :ivar id: The resource ID of the parent to which the connected registry will be associated. + :vartype id: str + :ivar sync_properties: The sync properties of the connected registry with its parent. Required. + :vartype sync_properties: ~azure.mgmt.containerregistry.models.SyncProperties """ - source_trigger: Optional["_models.PipelineSourceTriggerProperties"] = rest_field( - name="sourceTrigger", visibility=["read", "create", "update", "delete", "query"] + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource ID of the parent to which the connected registry will be associated.""" + sync_properties: "_models.SyncProperties" = rest_field( + name="syncProperties", visibility=["read", "create", "update", "delete", "query"] ) - """The source trigger properties of the pipeline.""" + """The sync properties of the connected registry with its parent. Required.""" @overload def __init__( self, *, - source_trigger: Optional["_models.PipelineSourceTriggerProperties"] = None, + sync_properties: "_models.SyncProperties", + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -3958,8 +2198,6 @@ class Policies(_Model): # pylint: disable=docstring-keyword-should-match-keywor audience token for a container registry. :vartype azure_ad_authentication_as_arm_policy: ~azure.mgmt.containerregistry.models.AzureADAuthenticationAsArmPolicy - :ivar soft_delete_policy: The soft delete policy for a container registry. - :vartype soft_delete_policy: ~azure.mgmt.containerregistry.models.SoftDeletePolicy """ quarantine_policy: Optional["_models.QuarantinePolicy"] = rest_field( @@ -3982,10 +2220,6 @@ class Policies(_Model): # pylint: disable=docstring-keyword-should-match-keywor name="azureADAuthenticationAsArmPolicy", visibility=["read", "create", "update", "delete", "query"] ) """The policy for using Azure Resource Manager audience token for a container registry.""" - soft_delete_policy: Optional["_models.SoftDeletePolicy"] = rest_field( - name="softDeletePolicy", visibility=["read", "create", "update", "delete", "query"] - ) - """The soft delete policy for a container registry.""" @overload def __init__( @@ -3996,7 +2230,6 @@ def __init__( retention_policy: Optional["_models.RetentionPolicy"] = None, export_policy: Optional["_models.ExportPolicy"] = None, azure_ad_authentication_as_arm_policy: Optional["_models.AzureADAuthenticationAsArmPolicy"] = None, - soft_delete_policy: Optional["_models.SoftDeletePolicy"] = None, ) -> None: ... @overload @@ -4294,34 +2527,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProgressProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The progress properties. - - :ivar percentage: The percentage complete of the copy operation. - :vartype percentage: str - """ - - percentage: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The percentage complete of the copy operation.""" - - @overload - def __init__( - self, - *, - percentage: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class QuarantinePolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The quarantine policy for a container registry. @@ -4485,9 +2690,6 @@ class Registry(TrackedResource): # pylint: disable=docstring-keyword-should-mat "network_rule_bypass_allowed_for_tasks", "zone_redundancy", "anonymous_pull_enabled", - "metadata_search", - "auto_generated_domain_name_label_scope", - "writable_cache_repos", "role_assignment_mode", ] @@ -4574,13 +2776,6 @@ class RegistryNameCheckRequest(_Model): # pylint: disable=docstring-keyword-sho :ivar type: The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. Required. "Microsoft.ContainerRegistry/registries" :vartype type: str or ~azure.mgmt.containerregistry.models.ContainerRegistryResourceType - :ivar resource_group_name: The resource group name of the container registry. - :vartype resource_group_name: str - :ivar auto_generated_domain_name_label_scope: The auto generated domain name label of the - container registry. This value defaults to "Unsecure". Known values are: "Unsecure", - "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and "NoReuse". - :vartype auto_generated_domain_name_label_scope: str or - ~azure.mgmt.containerregistry.models.AutoGeneratedDomainNameLabelScope """ name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -4590,16 +2785,6 @@ class RegistryNameCheckRequest(_Model): # pylint: disable=docstring-keyword-sho ) """The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. Required. \"Microsoft.ContainerRegistry/registries\"""" - resource_group_name: Optional[str] = rest_field( - name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"] - ) - """The resource group name of the container registry.""" - auto_generated_domain_name_label_scope: Optional[Union[str, "_models.AutoGeneratedDomainNameLabelScope"]] = ( - rest_field(name="autoGeneratedDomainNameLabelScope", visibility=["read", "create", "update", "delete", "query"]) - ) - """The auto generated domain name label of the container registry. This value defaults to - \"Unsecure\". Known values are: \"Unsecure\", \"TenantReuse\", \"SubscriptionReuse\", - \"ResourceGroupReuse\", and \"NoReuse\".""" @overload def __init__( @@ -4607,10 +2792,6 @@ def __init__( *, name: str, type: Union[str, "_models.ContainerRegistryResourceType"], - resource_group_name: Optional[str] = None, - auto_generated_domain_name_label_scope: Optional[ - Union[str, "_models.AutoGeneratedDomainNameLabelScope"] - ] = None, ) -> None: ... @overload @@ -4627,9 +2808,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class RegistryNameStatus(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The result of a request to check the availability of a container registry name. - :ivar available_login_server_name: The complete login server name with domain name label (DNL) - hash, if available. - :vartype available_login_server_name: str :ivar name_available: The value that indicates whether the name is available. :vartype name_available: bool :ivar reason: If any, the reason that the name is not available. @@ -4639,10 +2817,6 @@ class RegistryNameStatus(_Model): # pylint: disable=docstring-keyword-should-ma :vartype message: str """ - available_login_server_name: Optional[str] = rest_field( - name="availableLoginServerName", visibility=["read", "create", "update", "delete", "query"] - ) - """The complete login server name with domain name label (DNL) hash, if available.""" name_available: Optional[bool] = rest_field( name="nameAvailable", visibility=["read", "create", "update", "delete", "query"] ) @@ -4657,7 +2831,6 @@ class RegistryNameStatus(_Model): # pylint: disable=docstring-keyword-should-ma def __init__( self, *, - available_login_server_name: Optional[str] = None, name_available: Optional[bool] = None, reason: Optional[str] = None, message: Optional[str] = None, @@ -4763,17 +2936,6 @@ class RegistryProperties(_Model): # pylint: disable=docstring-keyword-should-ma :vartype zone_redundancy: str or ~azure.mgmt.containerregistry.models.ZoneRedundancy :ivar anonymous_pull_enabled: Enables registry-wide pull from unauthenticated clients. :vartype anonymous_pull_enabled: bool - :ivar metadata_search: Determines whether registry artifacts are indexed for metadata search. - Known values are: "Enabled" and "Disabled". - :vartype metadata_search: str or ~azure.mgmt.containerregistry.models.MetadataSearch - :ivar auto_generated_domain_name_label_scope: Determines the domain name label reuse scope. - Known values are: "Unsecure", "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and - "NoReuse". - :vartype auto_generated_domain_name_label_scope: str or - ~azure.mgmt.containerregistry.models.AutoGeneratedDomainNameLabelScope - :ivar writable_cache_repos: Whether to allow cache operations that write to repositories in - this registry. Known values are: "Enabled" and "Disabled". - :vartype writable_cache_repos: str or ~azure.mgmt.containerregistry.models.WritableCacheRepos :ivar role_assignment_mode: Determines registry role assignment mode. Known values are: "AbacRepositoryPermissions" and "LegacyRegistryPermissions". :vartype role_assignment_mode: str or ~azure.mgmt.containerregistry.models.RoleAssignmentMode @@ -4852,21 +3014,6 @@ class RegistryProperties(_Model): # pylint: disable=docstring-keyword-should-ma name="anonymousPullEnabled", visibility=["read", "create", "update", "delete", "query"] ) """Enables registry-wide pull from unauthenticated clients.""" - metadata_search: Optional[Union[str, "_models.MetadataSearch"]] = rest_field( - name="metadataSearch", visibility=["read", "create", "update", "delete", "query"] - ) - """Determines whether registry artifacts are indexed for metadata search. Known values are: - \"Enabled\" and \"Disabled\".""" - auto_generated_domain_name_label_scope: Optional[Union[str, "_models.AutoGeneratedDomainNameLabelScope"]] = ( - rest_field(name="autoGeneratedDomainNameLabelScope", visibility=["read", "create", "update", "delete", "query"]) - ) - """Determines the domain name label reuse scope. Known values are: \"Unsecure\", \"TenantReuse\", - \"SubscriptionReuse\", \"ResourceGroupReuse\", and \"NoReuse\".""" - writable_cache_repos: Optional[Union[str, "_models.WritableCacheRepos"]] = rest_field( - name="writableCacheRepos", visibility=["read", "create", "update", "delete", "query"] - ) - """Whether to allow cache operations that write to repositories in this registry. Known values - are: \"Enabled\" and \"Disabled\".""" role_assignment_mode: Optional[Union[str, "_models.RoleAssignmentMode"]] = rest_field( name="roleAssignmentMode", visibility=["read", "create", "update", "delete", "query"] ) @@ -4889,11 +3036,6 @@ def __init__( network_rule_bypass_allowed_for_tasks: Optional[bool] = None, zone_redundancy: Optional[Union[str, "_models.ZoneRedundancy"]] = None, anonymous_pull_enabled: Optional[bool] = None, - metadata_search: Optional[Union[str, "_models.MetadataSearch"]] = None, - auto_generated_domain_name_label_scope: Optional[ - Union[str, "_models.AutoGeneratedDomainNameLabelScope"] - ] = None, - writable_cache_repos: Optional[Union[str, "_models.WritableCacheRepos"]] = None, role_assignment_mode: Optional[Union[str, "_models.RoleAssignmentMode"]] = None, ) -> None: ... @@ -4939,12 +3081,6 @@ class RegistryPropertiesUpdateParameters(_Model): # pylint: disable=docstring-k :vartype network_rule_bypass_allowed_for_tasks: bool :ivar anonymous_pull_enabled: Enables registry-wide pull from unauthenticated clients. :vartype anonymous_pull_enabled: bool - :ivar metadata_search: Determines whether registry artifacts are indexed for metadata search. - Known values are: "Enabled" and "Disabled". - :vartype metadata_search: str or ~azure.mgmt.containerregistry.models.MetadataSearch - :ivar writable_cache_repos: Whether to allow cache operations that write to repositories in - this registry. Known values are: "Enabled" and "Disabled". - :vartype writable_cache_repos: str or ~azure.mgmt.containerregistry.models.WritableCacheRepos :ivar role_assignment_mode: Determines registry role assignment mode. Known values are: "AbacRepositoryPermissions" and "LegacyRegistryPermissions". :vartype role_assignment_mode: str or ~azure.mgmt.containerregistry.models.RoleAssignmentMode @@ -4996,16 +3132,6 @@ class RegistryPropertiesUpdateParameters(_Model): # pylint: disable=docstring-k name="anonymousPullEnabled", visibility=["read", "create", "update", "delete", "query"] ) """Enables registry-wide pull from unauthenticated clients.""" - metadata_search: Optional[Union[str, "_models.MetadataSearch"]] = rest_field( - name="metadataSearch", visibility=["read", "create", "update", "delete", "query"] - ) - """Determines whether registry artifacts are indexed for metadata search. Known values are: - \"Enabled\" and \"Disabled\".""" - writable_cache_repos: Optional[Union[str, "_models.WritableCacheRepos"]] = rest_field( - name="writableCacheRepos", visibility=["read", "create", "update", "delete", "query"] - ) - """Whether to allow cache operations that write to repositories in this registry. Known values - are: \"Enabled\" and \"Disabled\".""" role_assignment_mode: Optional[Union[str, "_models.RoleAssignmentMode"]] = rest_field( name="roleAssignmentMode", visibility=["read", "create", "update", "delete", "query"] ) @@ -5027,8 +3153,6 @@ def __init__( network_rule_bypass_options: Optional[Union[str, "_models.NetworkRuleBypassOptions"]] = None, network_rule_bypass_allowed_for_tasks: Optional[bool] = None, anonymous_pull_enabled: Optional[bool] = None, - metadata_search: Optional[Union[str, "_models.MetadataSearch"]] = None, - writable_cache_repos: Optional[Union[str, "_models.WritableCacheRepos"]] = None, role_assignment_mode: Optional[Union[str, "_models.RoleAssignmentMode"]] = None, ) -> None: ... @@ -5043,63 +3167,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RegistrySyncResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The registry sync result of the connected registry. - - :ivar sync_trigger: The action that triggered the most recent registry sync. Required. Known - values are: "SyncTokenUpdate", "InitialSync", "ManualResync", and "RecoveryService". - :vartype sync_trigger: str or ~azure.mgmt.containerregistry.models.SyncTrigger - :ivar sync_state: The status of the connected registry's most recent sync. Required. Known - values are: "NotActivated", "Syncing", "Failed", "Succeeded", "TimedOut", and "Pending". - :vartype sync_state: str or ~azure.mgmt.containerregistry.models.SyncState - :ivar last_sync_start_time: The time that the connected registry's most recent sync started. - :vartype last_sync_start_time: ~datetime.datetime - :ivar last_sync_end_time: The time that the connected registry's most recent sync ended. - :vartype last_sync_end_time: ~datetime.datetime - :ivar last_successful_sync_end_time: The time that the connected registry's most recent - successful sync ended. - :vartype last_successful_sync_end_time: ~datetime.datetime - """ - - sync_trigger: Union[str, "_models.SyncTrigger"] = rest_field(name="syncTrigger", visibility=["read"]) - """The action that triggered the most recent registry sync. Required. Known values are: - \"SyncTokenUpdate\", \"InitialSync\", \"ManualResync\", and \"RecoveryService\".""" - sync_state: Union[str, "_models.SyncState"] = rest_field(name="syncState", visibility=["read"]) - """The status of the connected registry's most recent sync. Required. Known values are: - \"NotActivated\", \"Syncing\", \"Failed\", \"Succeeded\", \"TimedOut\", and \"Pending\".""" - last_sync_start_time: Optional[datetime.datetime] = rest_field( - name="lastSyncStartTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The time that the connected registry's most recent sync started.""" - last_sync_end_time: Optional[datetime.datetime] = rest_field( - name="lastSyncEndTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The time that the connected registry's most recent sync ended.""" - last_successful_sync_end_time: Optional[datetime.datetime] = rest_field( - name="lastSuccessfulSyncEndTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The time that the connected registry's most recent successful sync ended.""" - - @overload - def __init__( - self, - *, - last_sync_start_time: Optional[datetime.datetime] = None, - last_sync_end_time: Optional[datetime.datetime] = None, - last_successful_sync_end_time: Optional[datetime.datetime] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class RegistryUpdateParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The parameters for updating a container registry. @@ -5138,8 +3205,6 @@ class RegistryUpdateParameters(_Model): # pylint: disable=docstring-keyword-sho "network_rule_bypass_options", "network_rule_bypass_allowed_for_tasks", "anonymous_pull_enabled", - "metadata_search", - "writable_cache_repos", "role_assignment_mode", ] @@ -5801,52 +3866,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SoftDeletePolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The soft delete policy for a container registry. - - :ivar retention_days: The number of days after which a soft-deleted item is permanently - deleted. - :vartype retention_days: int - :ivar last_updated_time: The timestamp when the policy was last updated. - :vartype last_updated_time: ~datetime.datetime - :ivar status: The value that indicates whether the policy is enabled or not. Known values are: - "enabled" and "disabled". - :vartype status: str or ~azure.mgmt.containerregistry.models.PolicyStatus - """ - - retention_days: Optional[int] = rest_field( - name="retentionDays", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of days after which a soft-deleted item is permanently deleted.""" - last_updated_time: Optional[datetime.datetime] = rest_field( - name="lastUpdatedTime", visibility=["read"], format="rfc3339" - ) - """The timestamp when the policy was last updated.""" - status: Optional[Union[str, "_models.PolicyStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\" - and \"disabled\".""" - - @overload - def __init__( - self, - *, - retention_days: Optional[int] = None, - status: Optional[Union[str, "_models.PolicyStatus"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class Source(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. @@ -5917,10 +3936,6 @@ class StatusDetailProperties(_Model): :vartype timestamp: ~datetime.datetime :ivar correlation_id: The correlation ID of the status. :vartype correlation_id: str - :ivar total_gib: The total disk space in gibibytes (Gib, base-2). - :vartype total_gib: float - :ivar available_gib: The available disk space in gibibytes (Gib, base-2). - :vartype available_gib: float """ type: Optional[str] = rest_field(visibility=["read"]) @@ -5933,10 +3948,6 @@ class StatusDetailProperties(_Model): """The timestamp of the status.""" correlation_id: Optional[str] = rest_field(name="correlationId", visibility=["read"]) """The correlation ID of the status.""" - total_gib: Optional[float] = rest_field(name="totalGib", visibility=["read"]) - """The total disk space in gibibytes (Gib, base-2).""" - available_gib: Optional[float] = rest_field(name="availableGib", visibility=["read"]) - """The available disk space in gibibytes (Gib, base-2).""" class SyncProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -5961,9 +3972,6 @@ class SyncProperties(_Model): # pylint: disable=docstring-keyword-should-match- :ivar gateway_endpoint: The gateway endpoint used by the connected registry to communicate with its parent. :vartype gateway_endpoint: str - :ivar auth_type: The authentication type used for the connected registry to sync with its - parent. Known values are: "SyncToken" and "ManagedIdentity". - :vartype auth_type: str or ~azure.mgmt.containerregistry.models.AuthType """ token_id: Optional[str] = rest_field(name="tokenId", visibility=["read", "create", "update", "delete", "query"]) @@ -5986,11 +3994,6 @@ class SyncProperties(_Model): # pylint: disable=docstring-keyword-should-match- """The last time a sync occurred between the connected registry and its parent.""" gateway_endpoint: Optional[str] = rest_field(name="gatewayEndpoint", visibility=["read"]) """The gateway endpoint used by the connected registry to communicate with its parent.""" - auth_type: Optional[Union[str, "_models.AuthType"]] = rest_field( - name="authType", visibility=["read", "create", "update", "delete", "query"] - ) - """The authentication type used for the connected registry to sync with its parent. Known values - are: \"SyncToken\" and \"ManagedIdentity\".""" @overload def __init__( @@ -6000,7 +4003,6 @@ def __init__( token_id: Optional[str] = None, schedule: Optional[str] = None, sync_window: Optional[datetime.timedelta] = None, - auth_type: Optional[Union[str, "_models.AuthType"]] = None, ) -> None: ... @overload @@ -6026,9 +4028,6 @@ class SyncUpdateProperties(_Model): # pylint: disable=docstring-keyword-should- :ivar message_ttl: 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. :vartype message_ttl: ~datetime.timedelta - :ivar auth_type: The authentication type used for the connected registry to sync with its - parent. Known values are: "SyncToken" and "ManagedIdentity". - :vartype auth_type: str or ~azure.mgmt.containerregistry.models.AuthType """ schedule: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -6044,11 +4043,6 @@ class SyncUpdateProperties(_Model): # pylint: disable=docstring-keyword-should- ) """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.""" - auth_type: Optional[Union[str, "_models.AuthType"]] = rest_field( - name="authType", visibility=["read", "create", "update", "delete", "query"] - ) - """The authentication type used for the connected registry to sync with its parent. Known values - are: \"SyncToken\" and \"ManagedIdentity\".""" @overload def __init__( @@ -6057,7 +4051,6 @@ def __init__( schedule: Optional[str] = None, sync_window: Optional[datetime.timedelta] = None, message_ttl: Optional[datetime.timedelta] = None, - auth_type: Optional[Union[str, "_models.AuthType"]] = None, ) -> None: ... @overload @@ -6630,21 +4623,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserAssignedIdentity(_Model): - """User assigned identity properties. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The principal ID of the assigned identity.""" - client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) - """The client ID of the assigned identity.""" - - class UserIdentityProperties(_Model): """UserIdentityProperties. diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/operations/__init__.py index a72d40cdc4ef..5dad0f409b6a 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/operations/__init__.py @@ -14,8 +14,6 @@ from ._operations import Operations # type: ignore from ._operations import RegistriesOperations # type: ignore -from ._operations import ArchivesOperations # type: ignore -from ._operations import ArchiveVersionsOperations # type: ignore from ._operations import CacheRulesOperations # type: ignore from ._operations import CredentialSetsOperations # type: ignore from ._operations import ConnectedRegistriesOperations # type: ignore @@ -23,9 +21,6 @@ from ._operations import ReplicationsOperations # type: ignore from ._operations import ScopeMapsOperations # type: ignore from ._operations import TokensOperations # type: ignore -from ._operations import ExportPipelinesOperations # type: ignore -from ._operations import ImportPipelinesOperations # type: ignore -from ._operations import PipelineRunsOperations # type: ignore from ._operations import WebhooksOperations # type: ignore from ._patch import __all__ as _patch_all @@ -35,8 +30,6 @@ __all__ = [ "Operations", "RegistriesOperations", - "ArchivesOperations", - "ArchiveVersionsOperations", "CacheRulesOperations", "CredentialSetsOperations", "ConnectedRegistriesOperations", @@ -44,9 +37,6 @@ "ReplicationsOperations", "ScopeMapsOperations", "TokensOperations", - "ExportPipelinesOperations", - "ImportPipelinesOperations", - "PipelineRunsOperations", "WebhooksOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/operations/_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/operations/_operations.py index b607d5746576..465a9192c9fe 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/operations/_operations.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/operations/_operations.py @@ -36,7 +36,6 @@ from .._configuration import ContainerRegistryManagementClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer -from .._validation import api_version_validation T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] @@ -50,7 +49,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +70,7 @@ def build_registries_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +99,7 @@ def build_registries_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +130,7 @@ def build_registries_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -160,7 +159,7 @@ def build_registries_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}" path_format_arguments = { @@ -183,7 +182,7 @@ def build_registries_list_by_resource_group_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +207,7 @@ def build_registries_list_request(subscription_id: str, **kwargs: Any) -> HttpRe _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -235,7 +234,7 @@ def build_registries_import_image_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage" path_format_arguments = { @@ -262,7 +261,7 @@ def build_registries_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -290,7 +289,7 @@ def build_registries_list_credentials_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +318,7 @@ def build_registries_regenerate_credential_request( # pylint: disable=name-too- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -350,7 +349,7 @@ def build_registries_generate_credentials_request( # pylint: disable=name-too-l _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -381,7 +380,7 @@ def build_registries_check_name_availability_request( # pylint: disable=name-to _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -409,7 +408,7 @@ def build_registries_get_private_link_resource_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -438,7 +437,7 @@ def build_registries_list_private_link_resources_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -460,28 +459,22 @@ def build_registries_list_private_link_resources_request( # pylint: disable=nam return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_archives_get_request( - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - subscription_id: str, - **kwargs: Any +def build_cache_rules_get_request( + resource_group_name: str, registry_name: str, cache_rule_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "packageType": _SERIALIZER.url("package_type", package_type, "str"), - "archiveName": _SERIALIZER.url("archive_name", archive_name, "str"), + "cacheRuleName": _SERIALIZER.url("cache_rule_name", cache_rule_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -495,29 +488,23 @@ def build_archives_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_archives_create_request( - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - subscription_id: str, - **kwargs: Any +def build_cache_rules_create_request( + resource_group_name: str, registry_name: str, cache_rule_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "packageType": _SERIALIZER.url("package_type", package_type, "str"), - "archiveName": _SERIALIZER.url("archive_name", archive_name, "str"), + "cacheRuleName": _SERIALIZER.url("cache_rule_name", cache_rule_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -533,29 +520,23 @@ def build_archives_create_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_archives_update_request( - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - subscription_id: str, - **kwargs: Any +def build_cache_rules_update_request( + resource_group_name: str, registry_name: str, cache_rule_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "packageType": _SERIALIZER.url("package_type", package_type, "str"), - "archiveName": _SERIALIZER.url("archive_name", archive_name, "str"), + "cacheRuleName": _SERIALIZER.url("cache_rule_name", cache_rule_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -571,25 +552,19 @@ def build_archives_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_archives_delete_request( - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - subscription_id: str, - **kwargs: Any +def build_cache_rules_delete_request( + resource_group_name: str, registry_name: str, cache_rule_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "packageType": _SERIALIZER.url("package_type", package_type, "str"), - "archiveName": _SERIALIZER.url("archive_name", archive_name, "str"), + "cacheRuleName": _SERIALIZER.url("cache_rule_name", cache_rule_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -600,22 +575,21 @@ def build_archives_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_archives_list_request( - resource_group_name: str, registry_name: str, package_type: str, subscription_id: str, **kwargs: Any +def build_cache_rules_list_request( + resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "packageType": _SERIALIZER.url("package_type", package_type, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -629,30 +603,22 @@ def build_archives_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_archive_versions_get_request( - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - subscription_id: str, - **kwargs: Any +def build_credential_sets_get_request( + resource_group_name: str, registry_name: str, credential_set_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "packageType": _SERIALIZER.url("package_type", package_type, "str"), - "archiveName": _SERIALIZER.url("archive_name", archive_name, "str"), - "archiveVersionName": _SERIALIZER.url("archive_version_name", archive_version_name, "str"), + "credentialSetName": _SERIALIZER.url("credential_set_name", credential_set_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -666,30 +632,23 @@ def build_archive_versions_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_archive_versions_create_request( - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - subscription_id: str, - **kwargs: Any +def build_credential_sets_create_request( + resource_group_name: str, registry_name: str, credential_set_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "packageType": _SERIALIZER.url("package_type", package_type, "str"), - "archiveName": _SERIALIZER.url("archive_name", archive_name, "str"), - "archiveVersionName": _SERIALIZER.url("archive_version_name", archive_version_name, "str"), + "credentialSetName": _SERIALIZER.url("credential_set_name", credential_set_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -698,32 +657,58 @@ def build_archive_versions_create_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_archive_versions_delete_request( - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - subscription_id: str, - **kwargs: Any +def build_credential_sets_update_request( + resource_group_name: str, registry_name: str, credential_set_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), + "credentialSetName": _SERIALIZER.url("credential_set_name", credential_set_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_credential_sets_delete_request( + resource_group_name: str, registry_name: str, credential_set_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "packageType": _SERIALIZER.url("package_type", package_type, "str"), - "archiveName": _SERIALIZER.url("archive_name", archive_name, "str"), - "archiveVersionName": _SERIALIZER.url("archive_version_name", archive_version_name, "str"), + "credentialSetName": _SERIALIZER.url("credential_set_name", credential_set_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -734,28 +719,21 @@ def build_archive_versions_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_archive_versions_list_request( - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - subscription_id: str, - **kwargs: Any +def build_credential_sets_list_request( + resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "packageType": _SERIALIZER.url("package_type", package_type, "str"), - "archiveName": _SERIALIZER.url("archive_name", archive_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -769,22 +747,22 @@ def build_archive_versions_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_cache_rules_get_request( - resource_group_name: str, registry_name: str, cache_rule_name: str, subscription_id: str, **kwargs: Any +def build_connected_registries_get_request( + resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "cacheRuleName": _SERIALIZER.url("cache_rule_name", cache_rule_name, "str"), + "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -798,23 +776,23 @@ def build_cache_rules_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_cache_rules_create_request( - resource_group_name: str, registry_name: str, cache_rule_name: str, subscription_id: str, **kwargs: Any +def build_connected_registries_create_request( # pylint: disable=name-too-long + resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "cacheRuleName": _SERIALIZER.url("cache_rule_name", cache_rule_name, "str"), + "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -830,23 +808,23 @@ def build_cache_rules_create_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_cache_rules_update_request( - resource_group_name: str, registry_name: str, cache_rule_name: str, subscription_id: str, **kwargs: Any +def build_connected_registries_update_request( # pylint: disable=name-too-long + resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "cacheRuleName": _SERIALIZER.url("cache_rule_name", cache_rule_name, "str"), + "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -862,19 +840,19 @@ def build_cache_rules_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_cache_rules_delete_request( - resource_group_name: str, registry_name: str, cache_rule_name: str, subscription_id: str, **kwargs: Any +def build_connected_registries_delete_request( # pylint: disable=name-too-long + resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "cacheRuleName": _SERIALIZER.url("cache_rule_name", cache_rule_name, "str"), + "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -885,17 +863,17 @@ def build_cache_rules_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_cache_rules_list_request( - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any +def build_connected_registries_list_request( + resource_group_name: str, registry_name: str, subscription_id: str, *, filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -906,6 +884,8 @@ def build_cache_rules_list_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -913,22 +893,19 @@ def build_cache_rules_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_credential_sets_get_request( - resource_group_name: str, registry_name: str, credential_set_name: str, subscription_id: str, **kwargs: Any +def build_connected_registries_deactivate_request( # pylint: disable=name-too-long + resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}/deactivate" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "credentialSetName": _SERIALIZER.url("credential_set_name", credential_set_name, "str"), + "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -936,29 +913,31 @@ def build_credential_sets_get_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_credential_sets_create_request( - resource_group_name: str, registry_name: str, credential_set_name: str, subscription_id: str, **kwargs: Any +def build_private_endpoint_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, + registry_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "credentialSetName": _SERIALIZER.url("credential_set_name", credential_set_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -967,30 +946,34 @@ def build_credential_sets_create_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_credential_sets_update_request( - resource_group_name: str, registry_name: str, credential_set_name: str, subscription_id: str, **kwargs: Any +def build_private_endpoint_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + registry_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "credentialSetName": _SERIALIZER.url("credential_set_name", credential_set_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1003,22 +986,28 @@ def build_credential_sets_update_request( _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_credential_sets_delete_request( - resource_group_name: str, registry_name: str, credential_set_name: str, subscription_id: str, **kwargs: Any +def build_private_endpoint_connections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + registry_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "credentialSetName": _SERIALIZER.url("credential_set_name", credential_set_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1029,17 +1018,17 @@ def build_credential_sets_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_credential_sets_list_request( +def build_private_endpoint_connections_list_request( # pylint: disable=name-too-long resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1057,22 +1046,22 @@ def build_credential_sets_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_connected_registries_get_request( - resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any +def build_replications_get_request( + resource_group_name: str, registry_name: str, replication_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), + "replicationName": _SERIALIZER.url("replication_name", replication_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1086,23 +1075,23 @@ def build_connected_registries_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_connected_registries_create_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any +def build_replications_create_request( + resource_group_name: str, registry_name: str, replication_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), + "replicationName": _SERIALIZER.url("replication_name", replication_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1118,23 +1107,23 @@ def build_connected_registries_create_request( # pylint: disable=name-too-long return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_connected_registries_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any +def build_replications_update_request( + resource_group_name: str, registry_name: str, replication_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), + "replicationName": _SERIALIZER.url("replication_name", replication_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1150,19 +1139,19 @@ def build_connected_registries_update_request( # pylint: disable=name-too-long return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_connected_registries_delete_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any +def build_replications_delete_request( + resource_group_name: str, registry_name: str, replication_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), + "replicationName": _SERIALIZER.url("replication_name", replication_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1173,17 +1162,17 @@ def build_connected_registries_delete_request( # pylint: disable=name-too-long return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_connected_registries_list_request( - resource_group_name: str, registry_name: str, subscription_id: str, *, filter: Optional[str] = None, **kwargs: Any +def build_replications_list_request( + resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1194,8 +1183,6 @@ def build_connected_registries_list_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1203,45 +1190,22 @@ def build_connected_registries_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_connected_registries_deactivate_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any +def build_scope_maps_get_request( + resource_group_name: str, registry_name: str, scope_map_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}/deactivate" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_connected_registries_resync_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, connected_registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}/resync" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "connectedRegistryName": _SERIALIZER.url("connected_registry_name", connected_registry_name, "str"), + "scopeMapName": _SERIALIZER.url("scope_map_name", scope_map_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1252,31 +1216,26 @@ def build_connected_registries_resync_request( # pylint: disable=name-too-long # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_private_endpoint_connections_get_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any +def build_scope_maps_create_request( + resource_group_name: str, registry_name: str, scope_map_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), + "scopeMapName": _SERIALIZER.url("scope_map_name", scope_map_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1285,34 +1244,30 @@ def build_private_endpoint_connections_get_request( # pylint: disable=name-too- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_private_endpoint_connections_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any +def build_scope_maps_update_request( + resource_group_name: str, registry_name: str, scope_map_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), + "scopeMapName": _SERIALIZER.url("scope_map_name", scope_map_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1325,28 +1280,22 @@ def build_private_endpoint_connections_create_or_update_request( # pylint: disa _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_private_endpoint_connections_delete_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any +def build_scope_maps_delete_request( + resource_group_name: str, registry_name: str, scope_map_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), + "scopeMapName": _SERIALIZER.url("scope_map_name", scope_map_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1357,17 +1306,17 @@ def build_private_endpoint_connections_delete_request( # pylint: disable=name-t return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_private_endpoint_connections_list_request( # pylint: disable=name-too-long +def build_scope_maps_list_request( resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1385,22 +1334,22 @@ def build_private_endpoint_connections_list_request( # pylint: disable=name-too return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_replications_get_request( - resource_group_name: str, registry_name: str, replication_name: str, subscription_id: str, **kwargs: Any +def build_tokens_get_request( + resource_group_name: str, registry_name: str, token_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "replicationName": _SERIALIZER.url("replication_name", replication_name, "str"), + "tokenName": _SERIALIZER.url("token_name", token_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1414,23 +1363,23 @@ def build_replications_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_replications_create_request( - resource_group_name: str, registry_name: str, replication_name: str, subscription_id: str, **kwargs: Any +def build_tokens_create_request( + resource_group_name: str, registry_name: str, token_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "replicationName": _SERIALIZER.url("replication_name", replication_name, "str"), + "tokenName": _SERIALIZER.url("token_name", token_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1446,23 +1395,23 @@ def build_replications_create_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_replications_update_request( - resource_group_name: str, registry_name: str, replication_name: str, subscription_id: str, **kwargs: Any +def build_tokens_update_request( + resource_group_name: str, registry_name: str, token_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "replicationName": _SERIALIZER.url("replication_name", replication_name, "str"), + "tokenName": _SERIALIZER.url("token_name", token_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1478,19 +1427,19 @@ def build_replications_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_replications_delete_request( - resource_group_name: str, registry_name: str, replication_name: str, subscription_id: str, **kwargs: Any +def build_tokens_delete_request( + resource_group_name: str, registry_name: str, token_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "replicationName": _SERIALIZER.url("replication_name", replication_name, "str"), + "tokenName": _SERIALIZER.url("token_name", token_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1501,17 +1450,17 @@ def build_replications_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_replications_list_request( +def build_tokens_list_request( resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1529,22 +1478,22 @@ def build_replications_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_scope_maps_get_request( - resource_group_name: str, registry_name: str, scope_map_name: str, subscription_id: str, **kwargs: Any +def build_webhooks_get_request( + resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "scopeMapName": _SERIALIZER.url("scope_map_name", scope_map_name, "str"), + "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1558,23 +1507,23 @@ def build_scope_maps_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_scope_maps_create_request( - resource_group_name: str, registry_name: str, scope_map_name: str, subscription_id: str, **kwargs: Any +def build_webhooks_create_request( + resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "scopeMapName": _SERIALIZER.url("scope_map_name", scope_map_name, "str"), + "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1590,23 +1539,23 @@ def build_scope_maps_create_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_scope_maps_update_request( - resource_group_name: str, registry_name: str, scope_map_name: str, subscription_id: str, **kwargs: Any +def build_webhooks_update_request( + resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "scopeMapName": _SERIALIZER.url("scope_map_name", scope_map_name, "str"), + "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1622,19 +1571,19 @@ def build_scope_maps_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_scope_maps_delete_request( - resource_group_name: str, registry_name: str, scope_map_name: str, subscription_id: str, **kwargs: Any +def build_webhooks_delete_request( + resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "scopeMapName": _SERIALIZER.url("scope_map_name", scope_map_name, "str"), + "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1645,17 +1594,17 @@ def build_scope_maps_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_scope_maps_list_request( +def build_webhooks_list_request( resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1673,22 +1622,22 @@ def build_scope_maps_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_tokens_get_request( - resource_group_name: str, registry_name: str, token_name: str, subscription_id: str, **kwargs: Any +def build_webhooks_ping_request( + resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "tokenName": _SERIALIZER.url("token_name", token_name, "str"), + "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1699,26 +1648,25 @@ def build_tokens_get_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_tokens_create_request( - resource_group_name: str, registry_name: str, token_name: str, subscription_id: str, **kwargs: Any +def build_webhooks_list_events_request( + resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "tokenName": _SERIALIZER.url("token_name", token_name, "str"), + "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1727,30 +1675,27 @@ def build_tokens_create_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_tokens_update_request( - resource_group_name: str, registry_name: str, token_name: str, subscription_id: str, **kwargs: Any +def build_webhooks_get_callback_config_request( # pylint: disable=name-too-long + resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "tokenName": _SERIALIZER.url("token_name", token_name, "str"), + "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1759,3571 +1704,55 @@ def build_tokens_update_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_tokens_delete_request( - resource_group_name: str, registry_name: str, token_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "tokenName": _SERIALIZER.url("token_name", token_name, "str"), - } +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - _url: str = _url.format(**path_format_arguments) # type: ignore + Instead, you should access the following operations through + :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s + :attr:`operations` attribute. + """ - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerRegistryManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.OperationDefinition"]: + """List the operations for the provider. + :return: An iterator like instance of OperationDefinition + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.OperationDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} -def build_tokens_list_request( - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + cls: ClsType[List[_models.OperationDefinition]] = kwargs.pop("cls", None) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } + def prepare_request(next_link=None): + if not next_link: - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_export_pipelines_get_request( - resource_group_name: str, registry_name: str, export_pipeline_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "exportPipelineName": _SERIALIZER.url("export_pipeline_name", export_pipeline_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_export_pipelines_create_request( - resource_group_name: str, registry_name: str, export_pipeline_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "exportPipelineName": _SERIALIZER.url("export_pipeline_name", export_pipeline_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_export_pipelines_delete_request( - resource_group_name: str, registry_name: str, export_pipeline_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "exportPipelineName": _SERIALIZER.url("export_pipeline_name", export_pipeline_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_export_pipelines_list_request( - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_import_pipelines_get_request( - resource_group_name: str, registry_name: str, import_pipeline_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "importPipelineName": _SERIALIZER.url("import_pipeline_name", import_pipeline_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_import_pipelines_create_request( - resource_group_name: str, registry_name: str, import_pipeline_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "importPipelineName": _SERIALIZER.url("import_pipeline_name", import_pipeline_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_import_pipelines_delete_request( - resource_group_name: str, registry_name: str, import_pipeline_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "importPipelineName": _SERIALIZER.url("import_pipeline_name", import_pipeline_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_import_pipelines_list_request( - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_pipeline_runs_get_request( - resource_group_name: str, registry_name: str, pipeline_run_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "pipelineRunName": _SERIALIZER.url("pipeline_run_name", pipeline_run_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_pipeline_runs_create_request( - resource_group_name: str, registry_name: str, pipeline_run_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "pipelineRunName": _SERIALIZER.url("pipeline_run_name", pipeline_run_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_pipeline_runs_delete_request( - resource_group_name: str, registry_name: str, pipeline_run_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "pipelineRunName": _SERIALIZER.url("pipeline_run_name", pipeline_run_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_pipeline_runs_list_request( - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_webhooks_get_request( - resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_webhooks_create_request( - resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_webhooks_update_request( - resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_webhooks_delete_request( - resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_webhooks_list_request( - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_webhooks_ping_request( - resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_webhooks_list_events_request( - resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_webhooks_get_callback_config_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, webhook_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-10-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "webhookName": _SERIALIZER.url("webhook_name", webhook_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.OperationDefinition"]: - """List the operations for the provider. - - :return: An iterator like instance of OperationDefinition - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.OperationDefinition] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OperationDefinition]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_operations_list_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OperationDefinition], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RegistriesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`registries` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> _models.Registry: - """Gets the properties of the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - - _request = build_registries_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Registry, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - registry_name: str, - registry: Union[_models.Registry, _types.Registry, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(registry, (IOBase, bytes)): - _content = registry - else: - _content = json.dumps(registry, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_create_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - registry: _models.Registry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Creates a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param registry: The parameters for creating a container registry. Required. - :type registry: ~azure.mgmt.containerregistry.models.Registry - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - registry: _types.Registry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Creates a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param registry: The parameters for creating a container registry. Required. - :type registry: ~azure.mgmt.containerregistry.types.Registry - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - registry: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Creates a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param registry: The parameters for creating a container registry. Required. - :type registry: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - registry_name: str, - registry: Union[_models.Registry, _types.Registry, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Creates a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param registry: The parameters for creating a container registry. Is either a Registry type or - a IO[bytes] type. Required. - :type registry: ~azure.mgmt.containerregistry.models.Registry or - ~azure.mgmt.containerregistry.types.Registry or IO[bytes] - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - registry=registry, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Registry, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Registry].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Registry]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - registry_name: str, - registry_update_parameters: Union[_models.RegistryUpdateParameters, _types.RegistryUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(registry_update_parameters, (IOBase, bytes)): - _content = registry_update_parameters - else: - _content = json.dumps(registry_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - registry_name: str, - registry_update_parameters: _models.RegistryUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Updates a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param registry_update_parameters: The parameters for updating a container registry. Required. - :type registry_update_parameters: ~azure.mgmt.containerregistry.models.RegistryUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - registry_name: str, - registry_update_parameters: _types.RegistryUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Updates a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param registry_update_parameters: The parameters for updating a container registry. Required. - :type registry_update_parameters: ~azure.mgmt.containerregistry.types.RegistryUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - registry_name: str, - registry_update_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Updates a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param registry_update_parameters: The parameters for updating a container registry. Required. - :type registry_update_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - registry_name: str, - registry_update_parameters: Union[_models.RegistryUpdateParameters, _types.RegistryUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Updates a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param registry_update_parameters: The parameters for updating a container registry. Is either - a RegistryUpdateParameters type or a IO[bytes] type. Required. - :type registry_update_parameters: ~azure.mgmt.containerregistry.models.RegistryUpdateParameters - or ~azure.mgmt.containerregistry.types.RegistryUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - registry_update_parameters=registry_update_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Registry, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Registry].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Registry]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registries_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Registry"]: - """Lists all the container registries under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of Registry - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Registry]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registries_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Registry], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Registry"]: - """Lists all the container registries under the specified subscription. - - :return: An iterator like instance of Registry - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Registry]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registries_list_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Registry], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _import_image_initial( - self, - resource_group_name: str, - registry_name: str, - parameters: Union[_models.ImportImageParameters, _types.ImportImageParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_import_image_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_import_image( - self, - resource_group_name: str, - registry_name: str, - parameters: _models.ImportImageParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Copies an image to this container registry from the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param parameters: The parameters specifying the image to copy and the source container - registry. Required. - :type parameters: ~azure.mgmt.containerregistry.models.ImportImageParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_import_image( - self, - resource_group_name: str, - registry_name: str, - parameters: _types.ImportImageParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Copies an image to this container registry from the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param parameters: The parameters specifying the image to copy and the source container - registry. Required. - :type parameters: ~azure.mgmt.containerregistry.types.ImportImageParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_import_image( - self, - resource_group_name: str, - registry_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Copies an image to this container registry from the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param parameters: The parameters specifying the image to copy and the source container - registry. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_import_image( - self, - resource_group_name: str, - registry_name: str, - parameters: Union[_models.ImportImageParameters, _types.ImportImageParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Copies an image to this container registry from the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param parameters: The parameters specifying the image to copy and the source container - registry. Is either a ImportImageParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerregistry.models.ImportImageParameters or - ~azure.mgmt.containerregistry.types.ImportImageParameters or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._import_image_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - parameters=parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_usages( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> _models.RegistryUsageListResult: - """Gets the quota usages for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: RegistryUsageListResult. The RegistryUsageListResult is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.RegistryUsageListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RegistryUsageListResult] = kwargs.pop("cls", None) - - _request = build_registries_list_usages_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RegistryUsageListResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_credentials( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> _models.RegistryListCredentialsResult: - """Lists the login credentials for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: RegistryListCredentialsResult. The RegistryListCredentialsResult is compatible with - MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.RegistryListCredentialsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RegistryListCredentialsResult] = kwargs.pop("cls", None) - - _request = build_registries_list_credentials_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RegistryListCredentialsResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def regenerate_credential( - self, - resource_group_name: str, - registry_name: str, - regenerate_credential_parameters: _models.RegenerateCredentialParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegistryListCredentialsResult: - """Regenerates one of the login credentials for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param regenerate_credential_parameters: Specifies name of the password which should be - regenerated -- password or password2. Required. - :type regenerate_credential_parameters: - ~azure.mgmt.containerregistry.models.RegenerateCredentialParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RegistryListCredentialsResult. The RegistryListCredentialsResult is compatible with - MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.RegistryListCredentialsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def regenerate_credential( - self, - resource_group_name: str, - registry_name: str, - regenerate_credential_parameters: _types.RegenerateCredentialParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegistryListCredentialsResult: - """Regenerates one of the login credentials for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param regenerate_credential_parameters: Specifies name of the password which should be - regenerated -- password or password2. Required. - :type regenerate_credential_parameters: - ~azure.mgmt.containerregistry.types.RegenerateCredentialParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RegistryListCredentialsResult. The RegistryListCredentialsResult is compatible with - MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.RegistryListCredentialsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def regenerate_credential( - self, - resource_group_name: str, - registry_name: str, - regenerate_credential_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegistryListCredentialsResult: - """Regenerates one of the login credentials for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param regenerate_credential_parameters: Specifies name of the password which should be - regenerated -- password or password2. Required. - :type regenerate_credential_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: RegistryListCredentialsResult. The RegistryListCredentialsResult is compatible with - MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.RegistryListCredentialsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def regenerate_credential( - self, - resource_group_name: str, - registry_name: str, - regenerate_credential_parameters: Union[ - _models.RegenerateCredentialParameters, _types.RegenerateCredentialParameters, IO[bytes] - ], - **kwargs: Any - ) -> _models.RegistryListCredentialsResult: - """Regenerates one of the login credentials for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param regenerate_credential_parameters: Specifies name of the password which should be - regenerated -- password or password2. Is either a RegenerateCredentialParameters type or a - IO[bytes] type. Required. - :type regenerate_credential_parameters: - ~azure.mgmt.containerregistry.models.RegenerateCredentialParameters or - ~azure.mgmt.containerregistry.types.RegenerateCredentialParameters or IO[bytes] - :return: RegistryListCredentialsResult. The RegistryListCredentialsResult is compatible with - MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.RegistryListCredentialsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RegistryListCredentialsResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(regenerate_credential_parameters, (IOBase, bytes)): - _content = regenerate_credential_parameters - else: - _content = json.dumps(regenerate_credential_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_regenerate_credential_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RegistryListCredentialsResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _generate_credentials_initial( - self, - resource_group_name: str, - registry_name: str, - generate_credentials_parameters: Union[ - _models.GenerateCredentialsParameters, _types.GenerateCredentialsParameters, IO[bytes] - ], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(generate_credentials_parameters, (IOBase, bytes)): - _content = generate_credentials_parameters - else: - _content = json.dumps(generate_credentials_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_generate_credentials_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_generate_credentials( - self, - resource_group_name: str, - registry_name: str, - generate_credentials_parameters: _models.GenerateCredentialsParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GenerateCredentialsResult]: - """Generate keys for a token of a specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param generate_credentials_parameters: The parameters for generating credentials. Required. - :type generate_credentials_parameters: - ~azure.mgmt.containerregistry.models.GenerateCredentialsParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns GenerateCredentialsResult. The - GenerateCredentialsResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.GenerateCredentialsResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_generate_credentials( - self, - resource_group_name: str, - registry_name: str, - generate_credentials_parameters: _types.GenerateCredentialsParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GenerateCredentialsResult]: - """Generate keys for a token of a specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param generate_credentials_parameters: The parameters for generating credentials. Required. - :type generate_credentials_parameters: - ~azure.mgmt.containerregistry.types.GenerateCredentialsParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns GenerateCredentialsResult. The - GenerateCredentialsResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.GenerateCredentialsResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_generate_credentials( - self, - resource_group_name: str, - registry_name: str, - generate_credentials_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GenerateCredentialsResult]: - """Generate keys for a token of a specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param generate_credentials_parameters: The parameters for generating credentials. Required. - :type generate_credentials_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns GenerateCredentialsResult. The - GenerateCredentialsResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.GenerateCredentialsResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_generate_credentials( - self, - resource_group_name: str, - registry_name: str, - generate_credentials_parameters: Union[ - _models.GenerateCredentialsParameters, _types.GenerateCredentialsParameters, IO[bytes] - ], - **kwargs: Any - ) -> LROPoller[_models.GenerateCredentialsResult]: - """Generate keys for a token of a specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param generate_credentials_parameters: The parameters for generating credentials. Is either a - GenerateCredentialsParameters type or a IO[bytes] type. Required. - :type generate_credentials_parameters: - ~azure.mgmt.containerregistry.models.GenerateCredentialsParameters or - ~azure.mgmt.containerregistry.types.GenerateCredentialsParameters or IO[bytes] - :return: An instance of LROPoller that returns GenerateCredentialsResult. The - GenerateCredentialsResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.GenerateCredentialsResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GenerateCredentialsResult] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._generate_credentials_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - generate_credentials_parameters=generate_credentials_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.GenerateCredentialsResult, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.GenerateCredentialsResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.GenerateCredentialsResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def check_name_availability( - self, - registry_name_check_request: _models.RegistryNameCheckRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegistryNameStatus: - """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 registry_name_check_request: The request body. Required. - :type registry_name_check_request: - ~azure.mgmt.containerregistry.models.RegistryNameCheckRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RegistryNameStatus. The RegistryNameStatus is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.RegistryNameStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def check_name_availability( - self, - registry_name_check_request: _types.RegistryNameCheckRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RegistryNameStatus: - """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 registry_name_check_request: The request body. Required. - :type registry_name_check_request: ~azure.mgmt.containerregistry.types.RegistryNameCheckRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RegistryNameStatus. The RegistryNameStatus is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.RegistryNameStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def check_name_availability( - self, registry_name_check_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RegistryNameStatus: - """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 registry_name_check_request: The request body. Required. - :type registry_name_check_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: RegistryNameStatus. The RegistryNameStatus is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.RegistryNameStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def check_name_availability( - self, - registry_name_check_request: Union[ - _models.RegistryNameCheckRequest, _types.RegistryNameCheckRequest, IO[bytes] - ], - **kwargs: Any - ) -> _models.RegistryNameStatus: - """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 registry_name_check_request: The request body. Is either a RegistryNameCheckRequest type - or a IO[bytes] type. Required. - :type registry_name_check_request: - ~azure.mgmt.containerregistry.models.RegistryNameCheckRequest or - ~azure.mgmt.containerregistry.types.RegistryNameCheckRequest or IO[bytes] - :return: RegistryNameStatus. The RegistryNameStatus is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.RegistryNameStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RegistryNameStatus] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(registry_name_check_request, (IOBase, bytes)): - _content = registry_name_check_request - else: - _content = json.dumps(registry_name_check_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_check_name_availability_request( - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RegistryNameStatus, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_private_link_resource( - self, resource_group_name: str, registry_name: str, group_name: str, **kwargs: Any - ) -> _models.PrivateLinkResource: - """Gets a private link resource by a specified group name for a container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param group_name: The name of the private link associated with the Azure resource. Required. - :type group_name: str - :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.PrivateLinkResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) - - _request = build_registries_get_private_link_resource_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PrivateLinkResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_private_link_resources( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> ItemPaged["_models.PrivateLinkResource"]: - """Lists the private link resources for a container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: An iterator like instance of PrivateLinkResource - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.PrivateLinkResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.PrivateLinkResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registries_list_private_link_resources_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.PrivateLinkResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ArchivesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`archives` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def get( - self, resource_group_name: str, registry_name: str, package_type: str, archive_name: str, **kwargs: Any - ) -> _models.Archive: - """Gets the properties of the archive. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :return: Archive. The Archive is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Archive - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Archive] = kwargs.pop("cls", None) - - _request = build_archives_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Archive, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def _create_initial( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: Union[_models.Archive, _types.Archive, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(archive_create_parameters, (IOBase, bytes)): - _content = archive_create_parameters - else: - _content = json.dumps(archive_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_archives_create_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: _models.Archive, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Archive]: - """Creates a archive for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_create_parameters: The parameters for creating a archive. Required. - :type archive_create_parameters: ~azure.mgmt.containerregistry.models.Archive - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Archive. The Archive is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Archive] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: _types.Archive, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Archive]: - """Creates a archive for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_create_parameters: The parameters for creating a archive. Required. - :type archive_create_parameters: ~azure.mgmt.containerregistry.types.Archive - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Archive. The Archive is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Archive] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Archive]: - """Creates a archive for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_create_parameters: The parameters for creating a archive. Required. - :type archive_create_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Archive. The Archive is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Archive] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def begin_create( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_create_parameters: Union[_models.Archive, _types.Archive, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Archive]: - """Creates a archive for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_create_parameters: The parameters for creating a archive. Is either a Archive - type or a IO[bytes] type. Required. - :type archive_create_parameters: ~azure.mgmt.containerregistry.models.Archive or - ~azure.mgmt.containerregistry.types.Archive or IO[bytes] - :return: An instance of LROPoller that returns Archive. The Archive is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Archive] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Archive] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_create_parameters=archive_create_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Archive, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Archive].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Archive]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def update( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: _models.ArchiveUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Archive: - """Updates a archive for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_update_parameters: The parameters for updating a archive. Required. - :type archive_update_parameters: ~azure.mgmt.containerregistry.models.ArchiveUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Archive. The Archive is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Archive - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: _types.ArchiveUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Archive: - """Updates a archive for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_update_parameters: The parameters for updating a archive. Required. - :type archive_update_parameters: ~azure.mgmt.containerregistry.types.ArchiveUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Archive. The Archive is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Archive - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Archive: - """Updates a archive for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_update_parameters: The parameters for updating a archive. Required. - :type archive_update_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Archive. The Archive is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Archive - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def update( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_update_parameters: Union[_models.ArchiveUpdateParameters, _types.ArchiveUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> _models.Archive: - """Updates a archive for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_update_parameters: The parameters for updating a archive. Is either a - ArchiveUpdateParameters type or a IO[bytes] type. Required. - :type archive_update_parameters: ~azure.mgmt.containerregistry.models.ArchiveUpdateParameters - or ~azure.mgmt.containerregistry.types.ArchiveUpdateParameters or IO[bytes] - :return: Archive. The Archive is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Archive - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Archive] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(archive_update_parameters, (IOBase, bytes)): - _content = archive_update_parameters - else: - _content = json.dumps(archive_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_archives_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Archive, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def _delete_initial( - self, resource_group_name: str, registry_name: str, package_type: str, archive_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_archives_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def begin_delete( - self, resource_group_name: str, registry_name: str, package_type: str, archive_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a archive from a container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def list( - self, resource_group_name: str, registry_name: str, package_type: str, **kwargs: Any - ) -> ItemPaged["_models.Archive"]: - """Lists all archives for the specified container registry and package type. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :return: An iterator like instance of Archive - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.Archive] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Archive]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_archives_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - subscription_id=self._config.subscription_id, + _request = build_operations_list_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -5363,7 +1792,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Archive], + List[_models.OperationDefinition], deserialized.get("value", []), ) if cls: @@ -5392,14 +1821,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ArchiveVersionsOperations: # pylint: disable=docstring-missing-param +class RegistriesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`archive_versions` attribute. + :attr:`registries` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -5412,46 +1841,16 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "archive_version_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def get( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - **kwargs: Any - ) -> _models.ArchiveVersion: - """Gets the properties of the archive version. + def get(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> _models.Registry: + """Gets the properties of the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_version_name: The name of the archive version resource. Required. - :type archive_version_name: str - :return: ArchiveVersion. The ArchiveVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ArchiveVersion + :return: Registry. The Registry is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.Registry :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5465,14 +1864,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ArchiveVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - _request = build_archive_versions_get_request( + _request = build_registries_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_version_name=archive_version_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -5507,36 +1903,18 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ArchiveVersion, response.json()) + deserialized = _deserialize(_models.Registry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "archive_version_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) def _create_initial( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, + registry: Union[_models.Registry, _types.Registry, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -5547,19 +1925,26 @@ def _create_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_archive_versions_create_request( + content_type = content_type or "application/json" + _content = None + if isinstance(registry, (IOBase, bytes)): + _content = registry + else: + _content = json.dumps(registry, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_registries_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_version_name=archive_version_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -5602,243 +1987,128 @@ def _create_initial( return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "archive_version_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) + @overload def begin_create( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, + registry: _models.Registry, + *, + content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ArchiveVersion]: - """Creates a archive version for a container registry with the specified parameters. + ) -> LROPoller[_models.Registry]: + """Creates a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_version_name: The name of the archive version resource. Required. - :type archive_version_name: str - :return: An instance of LROPoller that returns ArchiveVersion. The ArchiveVersion is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ArchiveVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ArchiveVersion] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_version_name=archive_version_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ArchiveVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ArchiveVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ArchiveVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "archive_version_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def _delete_initial( - self, - resource_group_name: str, - registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_archive_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_version_name=archive_version_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + :param registry: The parameters for creating a container registry. Required. + :type registry: ~azure.mgmt.containerregistry.models.Registry + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Registry. The Registry is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] + :raises ~azure.core.exceptions.HttpResponseError: + """ - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + @overload + def begin_create( + self, + resource_group_name: str, + registry_name: str, + registry: _types.Registry, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Registry]: + """Creates a container registry with the specified parameters. - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param registry: The parameters for creating a container registry. Required. + :type registry: ~azure.mgmt.containerregistry.types.Registry + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Registry. The Registry is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] + :raises ~azure.core.exceptions.HttpResponseError: + """ - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + @overload + def begin_create( + self, + resource_group_name: str, + registry_name: str, + registry: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Registry]: + """Creates a container registry with the specified parameters. - return deserialized # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param registry: The parameters for creating a container registry. Required. + :type registry: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Registry. The Registry is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "archive_version_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def begin_delete( + def begin_create( self, resource_group_name: str, registry_name: str, - package_type: str, - archive_name: str, - archive_version_name: str, + registry: Union[_models.Registry, _types.Registry, IO[bytes]], **kwargs: Any - ) -> LROPoller[None]: - """Deletes a archive version from a container registry. + ) -> LROPoller[_models.Registry]: + """Creates a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :param archive_version_name: The name of the archive version resource. Required. - :type archive_version_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param registry: The parameters for creating a container registry. Is either a Registry type or + a IO[bytes] type. Required. + :type registry: ~azure.mgmt.containerregistry.models.Registry or + ~azure.mgmt.containerregistry.types.Registry or IO[bytes] + :return: An instance of LROPoller that returns Registry. The Registry is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Registry] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._create_initial( resource_group_name=resource_group_name, registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - archive_version_name=archive_version_name, + registry=registry, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -5847,256 +2117,41 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "package_type", - "archive_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def list( - self, resource_group_name: str, registry_name: str, package_type: str, archive_name: str, **kwargs: Any - ) -> ItemPaged["_models.ArchiveVersion"]: - """Lists all archive versions for the specified container registry, repository type and archive - name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param package_type: The package type. Required. - :type package_type: str - :param archive_name: The name of the archive resource. Required. - :type archive_name: str - :return: An iterator like instance of ArchiveVersion - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.ArchiveVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ArchiveVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_archive_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - package_type=package_type, - archive_name=archive_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ArchiveVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def get_long_running_output(pipeline_response): response = pipeline_response.http_response + deserialized = _deserialize(_models.Registry, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class CacheRulesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`cache_rules` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any - ) -> _models.CacheRule: - """Gets the properties of the specified cache rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :return: CacheRule. The CacheRule is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.CacheRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) - - _request = build_cache_rules_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - cache_rule_name=cache_rule_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.CacheRule, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.Registry].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Registry]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _create_initial( + def _update_initial( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_create_parameters: Union[_models.CacheRule, _types.CacheRule, IO[bytes]], + registry_update_parameters: Union[_models.RegistryUpdateParameters, _types.RegistryUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -6115,15 +2170,14 @@ def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(cache_rule_create_parameters, (IOBase, bytes)): - _content = cache_rule_create_parameters + if isinstance(registry_update_parameters, (IOBase, bytes)): + _content = registry_update_parameters else: - _content = json.dumps(cache_rule_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(registry_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_cache_rules_create_request( + _request = build_registries_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -6171,140 +2225,248 @@ def _create_initial( return deserialized # type: ignore @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_create_parameters: _models.CacheRule, + registry_update_parameters: _models.RegistryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CacheRule]: - """Creates a cache rule for a container registry with the specified parameters. + ) -> LROPoller[_models.Registry]: + """Updates a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. - :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.models.CacheRule + :param registry_update_parameters: The parameters for updating a container registry. Required. + :type registry_update_parameters: ~azure.mgmt.containerregistry.models.RegistryUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with + :return: An instance of LROPoller that returns Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_create_parameters: _types.CacheRule, + registry_update_parameters: _types.RegistryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CacheRule]: - """Creates a cache rule for a container registry with the specified parameters. + ) -> LROPoller[_models.Registry]: + """Updates a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. - :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.types.CacheRule + :param registry_update_parameters: The parameters for updating a container registry. Required. + :type registry_update_parameters: ~azure.mgmt.containerregistry.types.RegistryUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with + :return: An instance of LROPoller that returns Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + registry_name: str, + registry_update_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Registry]: + """Updates a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param registry_update_parameters: The parameters for updating a container registry. Required. + :type registry_update_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Registry. The Registry is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + registry_name: str, + registry_update_parameters: Union[_models.RegistryUpdateParameters, _types.RegistryUpdateParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Registry]: + """Updates a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param registry_update_parameters: The parameters for updating a container registry. Is either + a RegistryUpdateParameters type or a IO[bytes] type. Required. + :type registry_update_parameters: ~azure.mgmt.containerregistry.models.RegistryUpdateParameters + or ~azure.mgmt.containerregistry.types.RegistryUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns Registry. The Registry is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Registry] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Registry] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + registry_update_parameters=registry_update_parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Registry, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Registry].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Registry]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_registries_delete_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - cache_rule_name: str, - cache_rule_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CacheRule]: - """Creates a cache rule for a container registry with the specified parameters. + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. - :type cache_rule_create_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace - def begin_create( - self, - resource_group_name: str, - registry_name: str, - cache_rule_name: str, - cache_rule_create_parameters: Union[_models.CacheRule, _types.CacheRule, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CacheRule]: - """Creates a cache rule for a container registry with the specified parameters. + def begin_delete(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_create_parameters: The parameters for creating a cache rule. Is either a - CacheRule type or a IO[bytes] type. Required. - :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.models.CacheRule or - ~azure.mgmt.containerregistry.types.CacheRule or IO[bytes] - :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, - cache_rule_create_parameters=cache_rule_create_parameters, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -6313,12 +2475,9 @@ def begin_create( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.CacheRule, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -6333,24 +2492,209 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.CacheRule].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.CacheRule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Registry"]: + """Lists all the container registries under the specified resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Registry + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.Registry] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Registry]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_registries_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Registry], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Registry"]: + """Lists all the container registries under the specified subscription. + + :return: An iterator like instance of Registry + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.Registry] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Registry]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_registries_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Registry], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - def _update_initial( + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _import_image_initial( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_update_parameters: Union[ - _models.CacheRuleUpdateParameters, _types.CacheRuleUpdateParameters, IO[bytes] - ], + parameters: Union[_models.ImportImageParameters, _types.ImportImageParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -6369,15 +2713,14 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(cache_rule_update_parameters, (IOBase, bytes)): - _content = cache_rule_update_parameters + if isinstance(parameters, (IOBase, bytes)): + _content = parameters else: - _content = json.dumps(cache_rule_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_cache_rules_update_request( + _request = build_registries_import_image_request( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -6398,7 +2741,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -6411,10 +2754,8 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -6425,274 +2766,126 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_import_image( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_update_parameters: _models.CacheRuleUpdateParameters, + parameters: _models.ImportImageParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CacheRule]: - """Updates a cache rule for a container registry with the specified parameters. + ) -> LROPoller[None]: + """Copies an image to this container registry from the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. - :type cache_rule_update_parameters: - ~azure.mgmt.containerregistry.models.CacheRuleUpdateParameters + :param parameters: The parameters specifying the image to copy and the source container + registry. Required. + :type parameters: ~azure.mgmt.containerregistry.models.ImportImageParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_import_image( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_update_parameters: _types.CacheRuleUpdateParameters, + parameters: _types.ImportImageParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CacheRule]: - """Updates a cache rule for a container registry with the specified parameters. + ) -> LROPoller[None]: + """Copies an image to this container registry from the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. - :type cache_rule_update_parameters: - ~azure.mgmt.containerregistry.types.CacheRuleUpdateParameters + :param parameters: The parameters specifying the image to copy and the source container + registry. Required. + :type parameters: ~azure.mgmt.containerregistry.types.ImportImageParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_import_image( self, resource_group_name: str, registry_name: str, - cache_rule_name: str, - cache_rule_update_parameters: IO[bytes], + parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CacheRule]: - """Updates a cache rule for a container registry with the specified parameters. + ) -> LROPoller[None]: + """Copies an image to this container registry from the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. - :type cache_rule_update_parameters: IO[bytes] + :param parameters: The parameters specifying the image to copy and the source container + registry. Required. + :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - registry_name: str, - cache_rule_name: str, - cache_rule_update_parameters: Union[ - _models.CacheRuleUpdateParameters, _types.CacheRuleUpdateParameters, IO[bytes] - ], - **kwargs: Any - ) -> LROPoller[_models.CacheRule]: - """Updates a cache rule for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str - :param cache_rule_update_parameters: The parameters for updating a cache rule. Is either a - CacheRuleUpdateParameters type or a IO[bytes] type. Required. - :type cache_rule_update_parameters: - ~azure.mgmt.containerregistry.models.CacheRuleUpdateParameters or - ~azure.mgmt.containerregistry.types.CacheRuleUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - cache_rule_name=cache_rule_name, - cache_rule_update_parameters=cache_rule_update_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.CacheRule, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CacheRule].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CacheRule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_cache_rules_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - cache_rule_name=cache_rule_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + """ @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any + def begin_import_image( + self, + resource_group_name: str, + registry_name: str, + parameters: Union[_models.ImportImageParameters, _types.ImportImageParameters, IO[bytes]], + **kwargs: Any ) -> LROPoller[None]: - """Deletes a cache rule resource from a container registry. + """Copies an image to this container registry from the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param cache_rule_name: The name of the cache rule. Required. - :type cache_rule_name: str + :param parameters: The parameters specifying the image to copy and the source container + registry. Is either a ImportImageParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.containerregistry.models.ImportImageParameters or + ~azure.mgmt.containerregistry.types.ImportImageParameters or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._import_image_initial( resource_group_name=resource_group_name, registry_name=registry_name, - cache_rule_name=cache_rule_name, + parameters=parameters, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -6727,140 +2920,18 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.CacheRule"]: - """Lists all cache rule resources for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: An iterator like instance of CacheRule - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.CacheRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CacheRule]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_cache_rules_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CacheRule], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class CredentialSetsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`credential_sets` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any - ) -> _models.CredentialSet: - """Gets the properties of the specified credential set resource. + def list_usages( + self, resource_group_name: str, registry_name: str, **kwargs: Any + ) -> _models.RegistryUsageListResult: + """Gets the quota usages for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :return: CredentialSet. The CredentialSet is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.CredentialSet + :return: RegistryUsageListResult. The RegistryUsageListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.RegistryUsageListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6874,12 +2945,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) + cls: ClsType[_models.RegistryUsageListResult] = kwargs.pop("cls", None) - _request = build_credential_sets_get_request( + _request = build_registries_list_usages_request( resource_group_name=resource_group_name, registry_name=registry_name, - credential_set_name=credential_set_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6914,21 +2984,29 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.CredentialSet, response.json()) + deserialized = _deserialize(_models.RegistryUsageListResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_initial( - self, - resource_group_name: str, - registry_name: str, - credential_set_name: str, - credential_set_create_parameters: Union[_models.CredentialSet, _types.CredentialSet, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + @distributed_trace + def list_credentials( + self, resource_group_name: str, registry_name: str, **kwargs: Any + ) -> _models.RegistryListCredentialsResult: + """Lists the login credentials for the specified container registry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :return: RegistryListCredentialsResult. The RegistryListCredentialsResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.RegistryListCredentialsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6937,27 +3015,16 @@ def _create_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(credential_set_create_parameters, (IOBase, bytes)): - _content = credential_set_create_parameters - else: - _content = json.dumps(credential_set_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RegistryListCredentialsResult] = kwargs.pop("cls", None) - _request = build_credential_sets_create_request( + _request = build_registries_list_credentials_request( resource_group_name=resource_group_name, registry_name=registry_name, - credential_set_name=credential_set_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -6967,18 +3034,19 @@ def _create_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -6986,203 +3054,206 @@ def _create_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RegistryListCredentialsResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - def begin_create( + def regenerate_credential( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_create_parameters: _models.CredentialSet, + regenerate_credential_parameters: _models.RegenerateCredentialParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CredentialSet]: - """Creates a credential set for a container registry with the specified parameters. + ) -> _models.RegistryListCredentialsResult: + """Regenerates one of the login credentials for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_create_parameters: The parameters for creating a credential set. - Required. - :type credential_set_create_parameters: ~azure.mgmt.containerregistry.models.CredentialSet + :param regenerate_credential_parameters: Specifies name of the password which should be + regenerated -- password or password2. Required. + :type regenerate_credential_parameters: + ~azure.mgmt.containerregistry.models.RegenerateCredentialParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :paramtype content_type: str + :return: RegistryListCredentialsResult. The RegistryListCredentialsResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.RegistryListCredentialsResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create( + def regenerate_credential( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_create_parameters: _types.CredentialSet, + regenerate_credential_parameters: _types.RegenerateCredentialParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CredentialSet]: - """Creates a credential set for a container registry with the specified parameters. + ) -> _models.RegistryListCredentialsResult: + """Regenerates one of the login credentials for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_create_parameters: The parameters for creating a credential set. - Required. - :type credential_set_create_parameters: ~azure.mgmt.containerregistry.types.CredentialSet + :param regenerate_credential_parameters: Specifies name of the password which should be + regenerated -- password or password2. Required. + :type regenerate_credential_parameters: + ~azure.mgmt.containerregistry.types.RegenerateCredentialParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :return: RegistryListCredentialsResult. The RegistryListCredentialsResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.RegistryListCredentialsResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create( + def regenerate_credential( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_create_parameters: IO[bytes], + regenerate_credential_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CredentialSet]: - """Creates a credential set for a container registry with the specified parameters. + ) -> _models.RegistryListCredentialsResult: + """Regenerates one of the login credentials for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_create_parameters: The parameters for creating a credential set. - Required. - :type credential_set_create_parameters: IO[bytes] + :param regenerate_credential_parameters: Specifies name of the password which should be + regenerated -- password or password2. Required. + :type regenerate_credential_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :return: RegistryListCredentialsResult. The RegistryListCredentialsResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.RegistryListCredentialsResult :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create( + def regenerate_credential( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_create_parameters: Union[_models.CredentialSet, _types.CredentialSet, IO[bytes]], + regenerate_credential_parameters: Union[ + _models.RegenerateCredentialParameters, _types.RegenerateCredentialParameters, IO[bytes] + ], **kwargs: Any - ) -> LROPoller[_models.CredentialSet]: - """Creates a credential set for a container registry with the specified parameters. + ) -> _models.RegistryListCredentialsResult: + """Regenerates one of the login credentials for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_create_parameters: The parameters for creating a credential set. Is - either a CredentialSet type or a IO[bytes] type. Required. - :type credential_set_create_parameters: ~azure.mgmt.containerregistry.models.CredentialSet or - ~azure.mgmt.containerregistry.types.CredentialSet or IO[bytes] - :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :param regenerate_credential_parameters: Specifies name of the password which should be + regenerated -- password or password2. Is either a RegenerateCredentialParameters type or a + IO[bytes] type. Required. + :type regenerate_credential_parameters: + ~azure.mgmt.containerregistry.models.RegenerateCredentialParameters or + ~azure.mgmt.containerregistry.types.RegenerateCredentialParameters or IO[bytes] + :return: RegistryListCredentialsResult. The RegistryListCredentialsResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.RegistryListCredentialsResult :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - credential_set_name=credential_set_name, - credential_set_create_parameters=credential_set_create_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.RegistryListCredentialsResult] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.CredentialSet, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(regenerate_credential_parameters, (IOBase, bytes)): + _content = regenerate_credential_parameters + else: + _content = json.dumps(regenerate_credential_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_registries_regenerate_credential_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.CredentialSet].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CredentialSet]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.RegistryListCredentialsResult, response.json()) - def _update_initial( + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _generate_credentials_initial( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_update_parameters: Union[ - _models.CredentialSetUpdateParameters, _types.CredentialSetUpdateParameters, IO[bytes] + generate_credentials_parameters: Union[ + _models.GenerateCredentialsParameters, _types.GenerateCredentialsParameters, IO[bytes] ], **kwargs: Any ) -> Iterator[bytes]: @@ -7202,15 +3273,14 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(credential_set_update_parameters, (IOBase, bytes)): - _content = credential_set_update_parameters + if isinstance(generate_credentials_parameters, (IOBase, bytes)): + _content = generate_credentials_parameters else: - _content = json.dumps(credential_set_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(generate_credentials_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_credential_sets_update_request( + _request = build_registries_generate_credentials_request( resource_group_name=resource_group_name, registry_name=registry_name, - credential_set_name=credential_set_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -7231,7 +3301,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -7244,10 +3314,8 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -7258,147 +3326,135 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_generate_credentials( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_update_parameters: _models.CredentialSetUpdateParameters, + generate_credentials_parameters: _models.GenerateCredentialsParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CredentialSet]: - """Updates a credential set for a container registry with the specified parameters. + ) -> LROPoller[_models.GenerateCredentialsResult]: + """Generate keys for a token of a specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_update_parameters: The parameters for updating a credential set. - Required. - :type credential_set_update_parameters: - ~azure.mgmt.containerregistry.models.CredentialSetUpdateParameters + :param generate_credentials_parameters: The parameters for generating credentials. Required. + :type generate_credentials_parameters: + ~azure.mgmt.containerregistry.models.GenerateCredentialsParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :return: An instance of LROPoller that returns GenerateCredentialsResult. The + GenerateCredentialsResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.GenerateCredentialsResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_generate_credentials( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_update_parameters: _types.CredentialSetUpdateParameters, + generate_credentials_parameters: _types.GenerateCredentialsParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CredentialSet]: - """Updates a credential set for a container registry with the specified parameters. + ) -> LROPoller[_models.GenerateCredentialsResult]: + """Generate keys for a token of a specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_update_parameters: The parameters for updating a credential set. - Required. - :type credential_set_update_parameters: - ~azure.mgmt.containerregistry.types.CredentialSetUpdateParameters + :param generate_credentials_parameters: The parameters for generating credentials. Required. + :type generate_credentials_parameters: + ~azure.mgmt.containerregistry.types.GenerateCredentialsParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :return: An instance of LROPoller that returns GenerateCredentialsResult. The + GenerateCredentialsResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.GenerateCredentialsResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_generate_credentials( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_update_parameters: IO[bytes], + generate_credentials_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CredentialSet]: - """Updates a credential set for a container registry with the specified parameters. + ) -> LROPoller[_models.GenerateCredentialsResult]: + """Generate keys for a token of a specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_update_parameters: The parameters for updating a credential set. - Required. - :type credential_set_update_parameters: IO[bytes] + :param generate_credentials_parameters: The parameters for generating credentials. Required. + :type generate_credentials_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :return: An instance of LROPoller that returns GenerateCredentialsResult. The + GenerateCredentialsResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.GenerateCredentialsResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update( + def begin_generate_credentials( self, resource_group_name: str, registry_name: str, - credential_set_name: str, - credential_set_update_parameters: Union[ - _models.CredentialSetUpdateParameters, _types.CredentialSetUpdateParameters, IO[bytes] + generate_credentials_parameters: Union[ + _models.GenerateCredentialsParameters, _types.GenerateCredentialsParameters, IO[bytes] ], **kwargs: Any - ) -> LROPoller[_models.CredentialSet]: - """Updates a credential set for a container registry with the specified parameters. + ) -> LROPoller[_models.GenerateCredentialsResult]: + """Generate keys for a token of a specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :param credential_set_update_parameters: The parameters for updating a credential set. Is - either a CredentialSetUpdateParameters type or a IO[bytes] type. Required. - :type credential_set_update_parameters: - ~azure.mgmt.containerregistry.models.CredentialSetUpdateParameters or - ~azure.mgmt.containerregistry.types.CredentialSetUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :param generate_credentials_parameters: The parameters for generating credentials. Is either a + GenerateCredentialsParameters type or a IO[bytes] type. Required. + :type generate_credentials_parameters: + ~azure.mgmt.containerregistry.models.GenerateCredentialsParameters or + ~azure.mgmt.containerregistry.types.GenerateCredentialsParameters or IO[bytes] + :return: An instance of LROPoller that returns GenerateCredentialsResult. The + GenerateCredentialsResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.GenerateCredentialsResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) + cls: ClsType[_models.GenerateCredentialsResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._generate_credentials_initial( resource_group_name=resource_group_name, registry_name=registry_name, - credential_set_name=credential_set_name, - credential_set_update_parameters=credential_set_update_parameters, + generate_credentials_parameters=generate_credentials_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -7410,7 +3466,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.CredentialSet, response.json()) + deserialized = _deserialize(_models.GenerateCredentialsResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -7428,19 +3484,96 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.CredentialSet].from_continuation_token( + return LROPoller[_models.GenerateCredentialsResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.CredentialSet]( + return LROPoller[_models.GenerateCredentialsResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( - self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any - ) -> Iterator[bytes]: + @overload + def check_name_availability( + self, + registry_name_check_request: _models.RegistryNameCheckRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegistryNameStatus: + """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 registry_name_check_request: The request body. Required. + :type registry_name_check_request: + ~azure.mgmt.containerregistry.models.RegistryNameCheckRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RegistryNameStatus. The RegistryNameStatus is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.RegistryNameStatus + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_name_availability( + self, + registry_name_check_request: _types.RegistryNameCheckRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegistryNameStatus: + """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 registry_name_check_request: The request body. Required. + :type registry_name_check_request: ~azure.mgmt.containerregistry.types.RegistryNameCheckRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RegistryNameStatus. The RegistryNameStatus is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.RegistryNameStatus + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_name_availability( + self, registry_name_check_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RegistryNameStatus: + """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 registry_name_check_request: The request body. Required. + :type registry_name_check_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RegistryNameStatus. The RegistryNameStatus is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.RegistryNameStatus + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def check_name_availability( + self, + registry_name_check_request: Union[ + _models.RegistryNameCheckRequest, _types.RegistryNameCheckRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.RegistryNameStatus: + """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 registry_name_check_request: The request body. Is either a RegistryNameCheckRequest type + or a IO[bytes] type. Required. + :type registry_name_check_request: + ~azure.mgmt.containerregistry.models.RegistryNameCheckRequest or + ~azure.mgmt.containerregistry.types.RegistryNameCheckRequest or IO[bytes] + :return: RegistryNameStatus. The RegistryNameStatus is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.RegistryNameStatus + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7449,17 +3582,24 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RegistryNameStatus] = kwargs.pop("cls", None) - _request = build_credential_sets_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - credential_set_name=credential_set_name, + content_type = content_type or "application/json" + _content = None + if isinstance(registry_name_check_request, (IOBase, bytes)): + _content = registry_name_check_request + else: + _content = json.dumps(registry_name_check_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_registries_check_name_availability_request( subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7469,18 +3609,19 @@ def _delete_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -7488,97 +3629,110 @@ def _delete_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RegistryNameStatus, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a credential set from a container registry. + def get_private_link_resource( + self, resource_group_name: str, registry_name: str, group_name: str, **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets a private link resource by a specified group name for a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param credential_set_name: The name of the credential set. Required. - :type credential_set_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param group_name: The name of the private link associated with the Azure resource. Required. + :type group_name: str + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - credential_set_name=credential_set_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) + _request = build_registries_get_private_link_resource_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + group_name=group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + deserialized = _deserialize(_models.PrivateLinkResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.CredentialSet"]: - """Lists all credential set resources for the specified container registry. + def list_private_link_resources( + self, resource_group_name: str, registry_name: str, **kwargs: Any + ) -> ItemPaged["_models.PrivateLinkResource"]: + """Lists the private link resources for a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of CredentialSet - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.CredentialSet] + :return: An iterator like instance of PrivateLinkResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.PrivateLinkResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.CredentialSet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.PrivateLinkResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7591,7 +3745,7 @@ def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> I def prepare_request(next_link=None): if not next_link: - _request = build_credential_sets_list_request( + _request = build_registries_list_private_link_resources_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, @@ -7634,7 +3788,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.CredentialSet], + List[_models.PrivateLinkResource], deserialized.get("value", []), ) if cls: @@ -7663,14 +3817,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ConnectedRegistriesOperations: # pylint: disable=docstring-missing-param +class CacheRulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`connected_registries` attribute. + :attr:`cache_rules` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -7684,19 +3838,19 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> _models.ConnectedRegistry: - """Gets the properties of the connected registry. + self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any + ) -> _models.CacheRule: + """Gets the properties of the specified cache rule resource. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :return: ConnectedRegistry. The ConnectedRegistry is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ConnectedRegistry + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :return: CacheRule. The CacheRule is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.CacheRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7710,12 +3864,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) + cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) - _request = build_connected_registries_get_request( + _request = build_cache_rules_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - connected_registry_name=connected_registry_name, + cache_rule_name=cache_rule_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -7750,7 +3904,7 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ConnectedRegistry, response.json()) + deserialized = _deserialize(_models.CacheRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -7761,8 +3915,8 @@ def _create_initial( self, resource_group_name: str, registry_name: str, - connected_registry_name: str, - connected_registry_create_parameters: Union[_models.ConnectedRegistry, _types.ConnectedRegistry, IO[bytes]], + cache_rule_name: str, + cache_rule_create_parameters: Union[_models.CacheRule, _types.CacheRule, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -7781,15 +3935,15 @@ def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(connected_registry_create_parameters, (IOBase, bytes)): - _content = connected_registry_create_parameters + if isinstance(cache_rule_create_parameters, (IOBase, bytes)): + _content = cache_rule_create_parameters else: - _content = json.dumps(connected_registry_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(cache_rule_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_connected_registries_create_request( + _request = build_cache_rules_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - connected_registry_name=connected_registry_name, + cache_rule_name=cache_rule_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -7841,31 +3995,29 @@ def begin_create( self, resource_group_name: str, registry_name: str, - connected_registry_name: str, - connected_registry_create_parameters: _models.ConnectedRegistry, + cache_rule_name: str, + cache_rule_create_parameters: _models.CacheRule, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ConnectedRegistry]: - """Creates a connected registry for a container registry with the specified parameters. + ) -> LROPoller[_models.CacheRule]: + """Creates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. - Required. - :type connected_registry_create_parameters: - ~azure.mgmt.containerregistry.models.ConnectedRegistry + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. + :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.models.CacheRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] + :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7874,31 +4026,29 @@ def begin_create( self, resource_group_name: str, registry_name: str, - connected_registry_name: str, - connected_registry_create_parameters: _types.ConnectedRegistry, + cache_rule_name: str, + cache_rule_create_parameters: _types.CacheRule, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ConnectedRegistry]: - """Creates a connected registry for a container registry with the specified parameters. + ) -> LROPoller[_models.CacheRule]: + """Creates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. - Required. - :type connected_registry_create_parameters: - ~azure.mgmt.containerregistry.types.ConnectedRegistry + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. + :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.types.CacheRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] + :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7907,30 +4057,29 @@ def begin_create( self, resource_group_name: str, registry_name: str, - connected_registry_name: str, - connected_registry_create_parameters: IO[bytes], + cache_rule_name: str, + cache_rule_create_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ConnectedRegistry]: - """Creates a connected registry for a container registry with the specified parameters. + ) -> LROPoller[_models.CacheRule]: + """Creates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. - Required. - :type connected_registry_create_parameters: IO[bytes] + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_create_parameters: The parameters for creating a cache rule. Required. + :type cache_rule_create_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] + :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7939,34 +4088,33 @@ def begin_create( self, resource_group_name: str, registry_name: str, - connected_registry_name: str, - connected_registry_create_parameters: Union[_models.ConnectedRegistry, _types.ConnectedRegistry, IO[bytes]], + cache_rule_name: str, + cache_rule_create_parameters: Union[_models.CacheRule, _types.CacheRule, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ConnectedRegistry]: - """Creates a connected registry for a container registry with the specified parameters. + ) -> LROPoller[_models.CacheRule]: + """Creates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. - Is either a ConnectedRegistry type or a IO[bytes] type. Required. - :type connected_registry_create_parameters: - ~azure.mgmt.containerregistry.models.ConnectedRegistry or - ~azure.mgmt.containerregistry.types.ConnectedRegistry or IO[bytes] - :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_create_parameters: The parameters for creating a cache rule. Is either a + CacheRule type or a IO[bytes] type. Required. + :type cache_rule_create_parameters: ~azure.mgmt.containerregistry.models.CacheRule or + ~azure.mgmt.containerregistry.types.CacheRule or IO[bytes] + :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) + cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -7974,8 +4122,8 @@ def begin_create( raw_result = self._create_initial( resource_group_name=resource_group_name, registry_name=registry_name, - connected_registry_name=connected_registry_name, - connected_registry_create_parameters=connected_registry_create_parameters, + cache_rule_name=cache_rule_name, + cache_rule_create_parameters=cache_rule_create_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -7987,7 +4135,7 @@ def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ConnectedRegistry, response.json()) + deserialized = _deserialize(_models.CacheRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -8005,13 +4153,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ConnectedRegistry].from_continuation_token( + return LROPoller[_models.CacheRule].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ConnectedRegistry]( + return LROPoller[_models.CacheRule]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -8019,9 +4167,9 @@ def _update_initial( self, resource_group_name: str, registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: Union[ - _models.ConnectedRegistryUpdateParameters, _types.ConnectedRegistryUpdateParameters, IO[bytes] + cache_rule_name: str, + cache_rule_update_parameters: Union[ + _models.CacheRuleUpdateParameters, _types.CacheRuleUpdateParameters, IO[bytes] ], **kwargs: Any ) -> Iterator[bytes]: @@ -8041,15 +4189,15 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(connected_registry_update_parameters, (IOBase, bytes)): - _content = connected_registry_update_parameters + if isinstance(cache_rule_update_parameters, (IOBase, bytes)): + _content = cache_rule_update_parameters else: - _content = json.dumps(connected_registry_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(cache_rule_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_connected_registries_update_request( + _request = build_cache_rules_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - connected_registry_name=connected_registry_name, + cache_rule_name=cache_rule_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -8101,31 +4249,30 @@ def begin_update( self, resource_group_name: str, registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: _models.ConnectedRegistryUpdateParameters, + cache_rule_name: str, + cache_rule_update_parameters: _models.CacheRuleUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ConnectedRegistry]: - """Updates a connected registry with the specified parameters. + ) -> LROPoller[_models.CacheRule]: + """Updates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. - Required. - :type connected_registry_update_parameters: - ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateParameters + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. + :type cache_rule_update_parameters: + ~azure.mgmt.containerregistry.models.CacheRuleUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] + :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8134,31 +4281,30 @@ def begin_update( self, resource_group_name: str, registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: _types.ConnectedRegistryUpdateParameters, + cache_rule_name: str, + cache_rule_update_parameters: _types.CacheRuleUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ConnectedRegistry]: - """Updates a connected registry with the specified parameters. + ) -> LROPoller[_models.CacheRule]: + """Updates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. - Required. - :type connected_registry_update_parameters: - ~azure.mgmt.containerregistry.types.ConnectedRegistryUpdateParameters + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. + :type cache_rule_update_parameters: + ~azure.mgmt.containerregistry.types.CacheRuleUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] + :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8167,30 +4313,29 @@ def begin_update( self, resource_group_name: str, registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: IO[bytes], + cache_rule_name: str, + cache_rule_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ConnectedRegistry]: - """Updates a connected registry with the specified parameters. + ) -> LROPoller[_models.CacheRule]: + """Updates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. - Required. - :type connected_registry_update_parameters: IO[bytes] + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_update_parameters: The parameters for updating a cache rule. Required. + :type cache_rule_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] + :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8199,36 +4344,36 @@ def begin_update( self, resource_group_name: str, registry_name: str, - connected_registry_name: str, - connected_registry_update_parameters: Union[ - _models.ConnectedRegistryUpdateParameters, _types.ConnectedRegistryUpdateParameters, IO[bytes] + cache_rule_name: str, + cache_rule_update_parameters: Union[ + _models.CacheRuleUpdateParameters, _types.CacheRuleUpdateParameters, IO[bytes] ], **kwargs: Any - ) -> LROPoller[_models.ConnectedRegistry]: - """Updates a connected registry with the specified parameters. + ) -> LROPoller[_models.CacheRule]: + """Updates a cache rule for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. - Is either a ConnectedRegistryUpdateParameters type or a IO[bytes] type. Required. - :type connected_registry_update_parameters: - ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateParameters or - ~azure.mgmt.containerregistry.types.ConnectedRegistryUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str + :param cache_rule_update_parameters: The parameters for updating a cache rule. Is either a + CacheRuleUpdateParameters type or a IO[bytes] type. Required. + :type cache_rule_update_parameters: + ~azure.mgmt.containerregistry.models.CacheRuleUpdateParameters or + ~azure.mgmt.containerregistry.types.CacheRuleUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns CacheRule. The CacheRule is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) + cls: ClsType[_models.CacheRule] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -8236,8 +4381,8 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - connected_registry_name=connected_registry_name, - connected_registry_update_parameters=connected_registry_update_parameters, + cache_rule_name=cache_rule_name, + cache_rule_update_parameters=cache_rule_update_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -8249,7 +4394,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ConnectedRegistry, response.json()) + deserialized = _deserialize(_models.CacheRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -8267,18 +4412,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ConnectedRegistry].from_continuation_token( + return LROPoller[_models.CacheRule].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ConnectedRegistry]( + return LROPoller[_models.CacheRule]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) def _delete_initial( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8293,10 +4438,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_connected_registries_delete_request( + _request = build_cache_rules_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - connected_registry_name=connected_registry_name, + cache_rule_name=cache_rule_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8315,7 +4460,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -8341,17 +4486,17 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, cache_rule_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes a connected registry from a container registry. + """Deletes a cache rule resource from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str + :param cache_rule_name: The name of the cache rule. Required. + :type cache_rule_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -8367,7 +4512,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - connected_registry_name=connected_registry_name, + cache_rule_name=cache_rule_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -8402,29 +4547,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list( - self, resource_group_name: str, registry_name: str, *, filter: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ConnectedRegistry"]: - """Lists all connected registries for the specified container registry. + def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.CacheRule"]: + """Lists all cache rule resources for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :keyword 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. Default - value is None. - :paramtype filter: str - :return: An iterator like instance of ConnectedRegistry - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.ConnectedRegistry] + :return: An iterator like instance of CacheRule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.CacheRule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ConnectedRegistry]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CacheRule]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8437,11 +4575,10 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_connected_registries_list_request( + _request = build_cache_rules_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, - filter=filter, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8481,7 +4618,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ConnectedRegistry], + List[_models.CacheRule], deserialized.get("value", []), ) if cls: @@ -8509,159 +4646,41 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - def _deactivate_initial( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) +class CredentialSetsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - _request = build_connected_registries_deactivate_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + Instead, you should access the following operations through + :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s + :attr:`credential_sets` attribute. + """ - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerRegistryManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_deactivate( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deactivates the connected registry instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._deactivate_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - connected_registry_name=connected_registry_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "connected_registry_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def resync( - self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any - ) -> _models.ConnectedRegistry: - """Resync the connected registry instance. + def get( + self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any + ) -> _models.CredentialSet: + """Gets the properties of the specified credential set resource. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param connected_registry_name: The name of the connected registry. Required. - :type connected_registry_name: str - :return: ConnectedRegistry. The ConnectedRegistry is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ConnectedRegistry + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :return: CredentialSet. The CredentialSet is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.CredentialSet :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8675,12 +4694,12 @@ def resync( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) + cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) - _request = build_connected_registries_resync_request( + _request = build_credential_sets_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - connected_registry_name=connected_registry_name, + credential_set_name=credential_set_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8715,51 +4734,21 @@ def resync( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ConnectedRegistry, response.json()) + deserialized = _deserialize(_models.CredentialSet, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - -class PrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Get the specified private endpoint connection associated with the container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _create_initial( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_create_parameters: Union[_models.CredentialSet, _types.CredentialSet, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8768,17 +4757,27 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_private_endpoint_connections_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(credential_set_create_parameters, (IOBase, bytes)): + _content = credential_set_create_parameters + else: + _content = json.dumps(credential_set_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_credential_sets_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - private_endpoint_connection_name=private_endpoint_connection_name, + credential_set_name=credential_set_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -8788,19 +4787,18 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -8808,23 +4806,203 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_create_parameters: _models.CredentialSet, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CredentialSet]: + """Creates a credential set for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_create_parameters: The parameters for creating a credential set. + Required. + :type credential_set_create_parameters: ~azure.mgmt.containerregistry.models.CredentialSet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_create_parameters: _types.CredentialSet, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CredentialSet]: + """Creates a credential set for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_create_parameters: The parameters for creating a credential set. + Required. + :type credential_set_create_parameters: ~azure.mgmt.containerregistry.types.CredentialSet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_create_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CredentialSet]: + """Creates a credential set for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_create_parameters: The parameters for creating a credential set. + Required. + :type credential_set_create_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + registry_name: str, + credential_set_name: str, + credential_set_create_parameters: Union[_models.CredentialSet, _types.CredentialSet, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CredentialSet]: + """Creates a credential set for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_create_parameters: The parameters for creating a credential set. Is + either a CredentialSet type or a IO[bytes] type. Required. + :type credential_set_create_parameters: ~azure.mgmt.containerregistry.models.CredentialSet or + ~azure.mgmt.containerregistry.types.CredentialSet or IO[bytes] + :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + credential_set_name=credential_set_name, + credential_set_create_parameters=credential_set_create_parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CredentialSet, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return deserialized # type: ignore + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CredentialSet].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CredentialSet]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _create_or_update_initial( + def _update_initial( self, resource_group_name: str, registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: Union[ - _models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes] + credential_set_name: str, + credential_set_update_parameters: Union[ + _models.CredentialSetUpdateParameters, _types.CredentialSetUpdateParameters, IO[bytes] ], **kwargs: Any ) -> Iterator[bytes]: @@ -8844,15 +5022,15 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(private_endpoint_connection, (IOBase, bytes)): - _content = private_endpoint_connection + if isinstance(credential_set_update_parameters, (IOBase, bytes)): + _content = credential_set_update_parameters else: - _content = json.dumps(private_endpoint_connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(credential_set_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_private_endpoint_connections_create_or_update_request( + _request = build_credential_sets_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - private_endpoint_connection_name=private_endpoint_connection_name, + credential_set_name=credential_set_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -8900,155 +5078,147 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: _models.PrivateEndpointConnection, + credential_set_name: str, + credential_set_update_parameters: _models.CredentialSetUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the container - registry. + ) -> LROPoller[_models.CredentialSet]: + """Updates a credential set for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: The parameters for creating a private endpoint connection. + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_update_parameters: The parameters for updating a credential set. Required. - :type private_endpoint_connection: - ~azure.mgmt.containerregistry.models.PrivateEndpointConnection + :type credential_set_update_parameters: + ~azure.mgmt.containerregistry.models.CredentialSetUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: _types.PrivateEndpointConnection, + credential_set_name: str, + credential_set_update_parameters: _types.CredentialSetUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the container - registry. + ) -> LROPoller[_models.CredentialSet]: + """Updates a credential set for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: The parameters for creating a private endpoint connection. + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_update_parameters: The parameters for updating a credential set. Required. - :type private_endpoint_connection: - ~azure.mgmt.containerregistry.types.PrivateEndpointConnection + :type credential_set_update_parameters: + ~azure.mgmt.containerregistry.types.CredentialSetUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: IO[bytes], + credential_set_name: str, + credential_set_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the container - registry. + ) -> LROPoller[_models.CredentialSet]: + """Updates a credential set for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: The parameters for creating a private endpoint connection. + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_update_parameters: The parameters for updating a credential set. Required. - :type private_endpoint_connection: IO[bytes] + :type credential_set_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def begin_update( self, resource_group_name: str, registry_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: Union[ - _models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes] + credential_set_name: str, + credential_set_update_parameters: Union[ + _models.CredentialSetUpdateParameters, _types.CredentialSetUpdateParameters, IO[bytes] ], **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the container - registry. + ) -> LROPoller[_models.CredentialSet]: + """Updates a credential set for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: The parameters for creating a private endpoint connection. - Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type private_endpoint_connection: - ~azure.mgmt.containerregistry.models.PrivateEndpointConnection or - ~azure.mgmt.containerregistry.types.PrivateEndpointConnection or IO[bytes] - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str + :param credential_set_update_parameters: The parameters for updating a credential set. Is + either a CredentialSetUpdateParameters type or a IO[bytes] type. Required. + :type credential_set_update_parameters: + ~azure.mgmt.containerregistry.models.CredentialSetUpdateParameters or + ~azure.mgmt.containerregistry.types.CredentialSetUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns CredentialSet. The CredentialSet is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.CredentialSet] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + cls: ClsType[_models.CredentialSet] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - private_endpoint_connection_name=private_endpoint_connection_name, - private_endpoint_connection=private_endpoint_connection, + credential_set_name=credential_set_name, + credential_set_update_parameters=credential_set_update_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -9060,7 +5230,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + deserialized = _deserialize(_models.CredentialSet, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -9078,18 +5248,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + return LROPoller[_models.CredentialSet].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PrivateEndpointConnection]( + return LROPoller[_models.CredentialSet]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) def _delete_initial( - self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9104,10 +5274,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_private_endpoint_connections_delete_request( + _request = build_credential_sets_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - private_endpoint_connection_name=private_endpoint_connection_name, + credential_set_name=credential_set_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9126,7 +5296,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -9152,17 +5322,17 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, credential_set_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes the specified private endpoint connection associated with the container registry. + """Deletes a credential set from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str + :param credential_set_name: The name of the credential set. Required. + :type credential_set_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -9178,7 +5348,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - private_endpoint_connection_name=private_endpoint_connection_name, + credential_set_name=credential_set_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -9213,25 +5383,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> ItemPaged["_models.PrivateEndpointConnection"]: - """List all private endpoint connections in a container registry. + def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.CredentialSet"]: + """Lists all credential set resources for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of PrivateEndpointConnection - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] + :return: An iterator like instance of CredentialSet + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.CredentialSet] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CredentialSet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9244,7 +5411,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_private_endpoint_connections_list_request( + _request = build_credential_sets_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, @@ -9287,7 +5454,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.PrivateEndpointConnection], + List[_models.CredentialSet], deserialized.get("value", []), ) if cls: @@ -9316,14 +5483,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ReplicationsOperations: # pylint: disable=docstring-missing-param +class ConnectedRegistriesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`replications` attribute. + :attr:`connected_registries` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -9337,19 +5504,19 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get( - self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any - ) -> _models.Replication: - """Gets the properties of the specified replication. + self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any + ) -> _models.ConnectedRegistry: + """Gets the properties of the connected registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :return: Replication. The Replication is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Replication + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :return: ConnectedRegistry. The ConnectedRegistry is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.ConnectedRegistry :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9363,12 +5530,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Replication] = kwargs.pop("cls", None) + cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) - _request = build_replications_get_request( + _request = build_connected_registries_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - replication_name=replication_name, + connected_registry_name=connected_registry_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9403,7 +5570,7 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Replication, response.json()) + deserialized = _deserialize(_models.ConnectedRegistry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -9414,8 +5581,8 @@ def _create_initial( self, resource_group_name: str, registry_name: str, - replication_name: str, - replication: Union[_models.Replication, _types.Replication, IO[bytes]], + connected_registry_name: str, + connected_registry_create_parameters: Union[_models.ConnectedRegistry, _types.ConnectedRegistry, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -9434,15 +5601,15 @@ def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(replication, (IOBase, bytes)): - _content = replication + if isinstance(connected_registry_create_parameters, (IOBase, bytes)): + _content = connected_registry_create_parameters else: - _content = json.dumps(replication, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(connected_registry_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_replications_create_request( + _request = build_connected_registries_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - replication_name=replication_name, + connected_registry_name=connected_registry_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9494,29 +5661,31 @@ def begin_create( self, resource_group_name: str, registry_name: str, - replication_name: str, - replication: _models.Replication, + connected_registry_name: str, + connected_registry_create_parameters: _models.ConnectedRegistry, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Replication]: - """Creates a replication for a container registry with the specified parameters. + ) -> LROPoller[_models.ConnectedRegistry]: + """Creates a connected registry for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication: The parameters for creating a replication. Required. - :type replication: ~azure.mgmt.containerregistry.models.Replication + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. + Required. + :type connected_registry_create_parameters: + ~azure.mgmt.containerregistry.models.ConnectedRegistry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Replication. The Replication is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] + :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9525,29 +5694,31 @@ def begin_create( self, resource_group_name: str, registry_name: str, - replication_name: str, - replication: _types.Replication, + connected_registry_name: str, + connected_registry_create_parameters: _types.ConnectedRegistry, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Replication]: - """Creates a replication for a container registry with the specified parameters. + ) -> LROPoller[_models.ConnectedRegistry]: + """Creates a connected registry for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication: The parameters for creating a replication. Required. - :type replication: ~azure.mgmt.containerregistry.types.Replication + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. + Required. + :type connected_registry_create_parameters: + ~azure.mgmt.containerregistry.types.ConnectedRegistry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Replication. The Replication is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] + :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9556,29 +5727,30 @@ def begin_create( self, resource_group_name: str, registry_name: str, - replication_name: str, - replication: IO[bytes], + connected_registry_name: str, + connected_registry_create_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Replication]: - """Creates a replication for a container registry with the specified parameters. + ) -> LROPoller[_models.ConnectedRegistry]: + """Creates a connected registry for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication: The parameters for creating a replication. Required. - :type replication: IO[bytes] + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. + Required. + :type connected_registry_create_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Replication. The Replication is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] + :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9587,33 +5759,34 @@ def begin_create( self, resource_group_name: str, registry_name: str, - replication_name: str, - replication: Union[_models.Replication, _types.Replication, IO[bytes]], + connected_registry_name: str, + connected_registry_create_parameters: Union[_models.ConnectedRegistry, _types.ConnectedRegistry, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Replication]: - """Creates a replication for a container registry with the specified parameters. + ) -> LROPoller[_models.ConnectedRegistry]: + """Creates a connected registry for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication: The parameters for creating a replication. Is either a Replication type or - a IO[bytes] type. Required. - :type replication: ~azure.mgmt.containerregistry.models.Replication or - ~azure.mgmt.containerregistry.types.Replication or IO[bytes] - :return: An instance of LROPoller that returns Replication. The Replication is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_create_parameters: The parameters for creating a connectedRegistry. + Is either a ConnectedRegistry type or a IO[bytes] type. Required. + :type connected_registry_create_parameters: + ~azure.mgmt.containerregistry.models.ConnectedRegistry or + ~azure.mgmt.containerregistry.types.ConnectedRegistry or IO[bytes] + :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Replication] = kwargs.pop("cls", None) + cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -9621,8 +5794,8 @@ def begin_create( raw_result = self._create_initial( resource_group_name=resource_group_name, registry_name=registry_name, - replication_name=replication_name, - replication=replication, + connected_registry_name=connected_registry_name, + connected_registry_create_parameters=connected_registry_create_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -9634,7 +5807,7 @@ def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Replication, response.json()) + deserialized = _deserialize(_models.ConnectedRegistry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -9652,13 +5825,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Replication].from_continuation_token( + return LROPoller[_models.ConnectedRegistry].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Replication]( + return LROPoller[_models.ConnectedRegistry]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -9666,9 +5839,9 @@ def _update_initial( self, resource_group_name: str, registry_name: str, - replication_name: str, - replication_update_parameters: Union[ - _models.ReplicationUpdateParameters, _types.ReplicationUpdateParameters, IO[bytes] + connected_registry_name: str, + connected_registry_update_parameters: Union[ + _models.ConnectedRegistryUpdateParameters, _types.ConnectedRegistryUpdateParameters, IO[bytes] ], **kwargs: Any ) -> Iterator[bytes]: @@ -9688,15 +5861,15 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(replication_update_parameters, (IOBase, bytes)): - _content = replication_update_parameters + if isinstance(connected_registry_update_parameters, (IOBase, bytes)): + _content = connected_registry_update_parameters else: - _content = json.dumps(replication_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(connected_registry_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_replications_update_request( + _request = build_connected_registries_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - replication_name=replication_name, + connected_registry_name=connected_registry_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9748,30 +5921,31 @@ def begin_update( self, resource_group_name: str, registry_name: str, - replication_name: str, - replication_update_parameters: _models.ReplicationUpdateParameters, + connected_registry_name: str, + connected_registry_update_parameters: _models.ConnectedRegistryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Replication]: - """Updates a replication for a container registry with the specified parameters. + ) -> LROPoller[_models.ConnectedRegistry]: + """Updates a connected registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication_update_parameters: The parameters for updating a replication. Required. - :type replication_update_parameters: - ~azure.mgmt.containerregistry.models.ReplicationUpdateParameters + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. + Required. + :type connected_registry_update_parameters: + ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Replication. The Replication is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] + :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9780,30 +5954,31 @@ def begin_update( self, resource_group_name: str, registry_name: str, - replication_name: str, - replication_update_parameters: _types.ReplicationUpdateParameters, + connected_registry_name: str, + connected_registry_update_parameters: _types.ConnectedRegistryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Replication]: - """Updates a replication for a container registry with the specified parameters. + ) -> LROPoller[_models.ConnectedRegistry]: + """Updates a connected registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication_update_parameters: The parameters for updating a replication. Required. - :type replication_update_parameters: - ~azure.mgmt.containerregistry.types.ReplicationUpdateParameters + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. + Required. + :type connected_registry_update_parameters: + ~azure.mgmt.containerregistry.types.ConnectedRegistryUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Replication. The Replication is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] + :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9812,29 +5987,30 @@ def begin_update( self, resource_group_name: str, registry_name: str, - replication_name: str, - replication_update_parameters: IO[bytes], + connected_registry_name: str, + connected_registry_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Replication]: - """Updates a replication for a container registry with the specified parameters. + ) -> LROPoller[_models.ConnectedRegistry]: + """Updates a connected registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication_update_parameters: The parameters for updating a replication. Required. - :type replication_update_parameters: IO[bytes] + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. + Required. + :type connected_registry_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Replication. The Replication is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] + :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9843,36 +6019,36 @@ def begin_update( self, resource_group_name: str, registry_name: str, - replication_name: str, - replication_update_parameters: Union[ - _models.ReplicationUpdateParameters, _types.ReplicationUpdateParameters, IO[bytes] + connected_registry_name: str, + connected_registry_update_parameters: Union[ + _models.ConnectedRegistryUpdateParameters, _types.ConnectedRegistryUpdateParameters, IO[bytes] ], **kwargs: Any - ) -> LROPoller[_models.Replication]: - """Updates a replication for a container registry with the specified parameters. + ) -> LROPoller[_models.ConnectedRegistry]: + """Updates a connected registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str - :param replication_update_parameters: The parameters for updating a replication. Is either a - ReplicationUpdateParameters type or a IO[bytes] type. Required. - :type replication_update_parameters: - ~azure.mgmt.containerregistry.models.ReplicationUpdateParameters or - ~azure.mgmt.containerregistry.types.ReplicationUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns Replication. The Replication is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :param connected_registry_update_parameters: The parameters for updating a connectedRegistry. + Is either a ConnectedRegistryUpdateParameters type or a IO[bytes] type. Required. + :type connected_registry_update_parameters: + ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateParameters or + ~azure.mgmt.containerregistry.types.ConnectedRegistryUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns ConnectedRegistry. The ConnectedRegistry is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Replication] = kwargs.pop("cls", None) + cls: ClsType[_models.ConnectedRegistry] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -9880,8 +6056,8 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - replication_name=replication_name, - replication_update_parameters=replication_update_parameters, + connected_registry_name=connected_registry_name, + connected_registry_update_parameters=connected_registry_update_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -9893,7 +6069,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Replication, response.json()) + deserialized = _deserialize(_models.ConnectedRegistry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -9911,18 +6087,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Replication].from_continuation_token( + return LROPoller[_models.ConnectedRegistry].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Replication]( + return LROPoller[_models.ConnectedRegistry]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) def _delete_initial( - self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9937,10 +6113,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_replications_delete_request( + _request = build_connected_registries_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - replication_name=replication_name, + connected_registry_name=connected_registry_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9985,17 +6161,17 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes a replication from a container registry. + """Deletes a connected registry from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param replication_name: The name of the replication. Required. - :type replication_name: str + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -10011,7 +6187,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - replication_name=replication_name, + connected_registry_name=connected_registry_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10046,22 +6222,29 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.Replication"]: - """Lists all the replications for the specified container registry. + def list( + self, resource_group_name: str, registry_name: str, *, filter: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.ConnectedRegistry"]: + """Lists all connected registries for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of Replication - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.Replication] + :keyword 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. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of ConnectedRegistry + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.ConnectedRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Replication]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ConnectedRegistry]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10074,10 +6257,11 @@ def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> I def prepare_request(next_link=None): if not next_link: - _request = build_replications_list_request( + _request = build_connected_registries_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, + filter=filter, api_version=self._config.api_version, headers=_headers, params=_params, @@ -10117,7 +6301,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Replication], + List[_models.ConnectedRegistry], deserialized.get("value", []), ) if cls: @@ -10145,106 +6329,8 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - -class ScopeMapsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`scope_maps` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any) -> _models.ScopeMap: - """Gets the properties of the specified scope map. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :return: ScopeMap. The ScopeMap is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ScopeMap - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) - - _request = build_scope_maps_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - scope_map_name=scope_map_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ScopeMap, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_create_parameters: Union[_models.ScopeMap, _types.ScopeMap, IO[bytes]], - **kwargs: Any + def _deactivate_initial( + self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10254,27 +6340,17 @@ def _create_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(scope_map_create_parameters, (IOBase, bytes)): - _content = scope_map_create_parameters - else: - _content = json.dumps(scope_map_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_scope_maps_create_request( + _request = build_connected_registries_deactivate_request( resource_group_name=resource_group_name, registry_name=registry_name, - scope_map_name=scope_map_name, + connected_registry_name=connected_registry_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -10291,7 +6367,7 @@ def _create_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -10304,10 +6380,8 @@ def _create_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -10317,141 +6391,35 @@ def _create_initial( return deserialized # type: ignore - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_create_parameters: _models.ScopeMap, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ScopeMap]: - """Creates a scope map for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_create_parameters: The parameters for creating a scope map. Required. - :type scope_map_create_parameters: ~azure.mgmt.containerregistry.models.ScopeMap - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_create_parameters: _types.ScopeMap, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ScopeMap]: - """Creates a scope map for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_create_parameters: The parameters for creating a scope map. Required. - :type scope_map_create_parameters: ~azure.mgmt.containerregistry.types.ScopeMap - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ScopeMap]: - """Creates a scope map for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_create_parameters: The parameters for creating a scope map. Required. - :type scope_map_create_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def begin_create( - self, - resource_group_name: str, - registry_name: str, - scope_map_name: str, - scope_map_create_parameters: Union[_models.ScopeMap, _types.ScopeMap, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ScopeMap]: - """Creates a scope map for a container registry with the specified parameters. + def begin_deactivate( + self, resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deactivates the connected registry instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_create_parameters: The parameters for creating a scope map. Is either a - ScopeMap type or a IO[bytes] type. Required. - :type scope_map_create_parameters: ~azure.mgmt.containerregistry.models.ScopeMap or - ~azure.mgmt.containerregistry.types.ScopeMap or IO[bytes] - :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] + :param connected_registry_name: The name of the connected registry. Required. + :type connected_registry_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_initial( + raw_result = self._deactivate_initial( resource_group_name=resource_group_name, registry_name=registry_name, - scope_map_name=scope_map_name, - scope_map_create_parameters=scope_map_create_parameters, - content_type=content_type, + connected_registry_name=connected_registry_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10460,12 +6428,9 @@ def begin_create( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ScopeMap, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -10480,23 +6445,117 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ScopeMap].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ScopeMap]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class PrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerRegistryManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def _update_initial( + @distributed_trace + def get( + self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Get the specified private endpoint connection associated with the container registry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_get_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( self, resource_group_name: str, registry_name: str, - scope_map_name: str, - scope_map_update_parameters: Union[ - _models.ScopeMapUpdateParameters, _types.ScopeMapUpdateParameters, IO[bytes] + private_endpoint_connection_name: str, + private_endpoint_connection: Union[ + _models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes] ], **kwargs: Any ) -> Iterator[bytes]: @@ -10516,15 +6575,15 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(scope_map_update_parameters, (IOBase, bytes)): - _content = scope_map_update_parameters + if isinstance(private_endpoint_connection, (IOBase, bytes)): + _content = private_endpoint_connection else: - _content = json.dumps(scope_map_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(private_endpoint_connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_scope_maps_update_request( + _request = build_private_endpoint_connections_create_or_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - scope_map_name=scope_map_name, + private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -10572,143 +6631,155 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_create_or_update( self, resource_group_name: str, registry_name: str, - scope_map_name: str, - scope_map_update_parameters: _models.ScopeMapUpdateParameters, + private_endpoint_connection_name: str, + private_endpoint_connection: _models.PrivateEndpointConnection, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ScopeMap]: - """Updates a scope map with the specified parameters. + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the container + registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_update_parameters: The parameters for updating a scope map. Required. - :type scope_map_update_parameters: - ~azure.mgmt.containerregistry.models.ScopeMapUpdateParameters + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The parameters for creating a private endpoint connection. + Required. + :type private_endpoint_connection: + ~azure.mgmt.containerregistry.models.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create_or_update( self, resource_group_name: str, registry_name: str, - scope_map_name: str, - scope_map_update_parameters: _types.ScopeMapUpdateParameters, + private_endpoint_connection_name: str, + private_endpoint_connection: _types.PrivateEndpointConnection, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ScopeMap]: - """Updates a scope map with the specified parameters. + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the container + registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_update_parameters: The parameters for updating a scope map. Required. - :type scope_map_update_parameters: ~azure.mgmt.containerregistry.types.ScopeMapUpdateParameters + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The parameters for creating a private endpoint connection. + Required. + :type private_endpoint_connection: + ~azure.mgmt.containerregistry.types.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create_or_update( self, resource_group_name: str, registry_name: str, - scope_map_name: str, - scope_map_update_parameters: IO[bytes], + private_endpoint_connection_name: str, + private_endpoint_connection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ScopeMap]: - """Updates a scope map with the specified parameters. + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the container + registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_update_parameters: The parameters for updating a scope map. Required. - :type scope_map_update_parameters: IO[bytes] + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The parameters for creating a private endpoint connection. + Required. + :type private_endpoint_connection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update( + def begin_create_or_update( self, resource_group_name: str, registry_name: str, - scope_map_name: str, - scope_map_update_parameters: Union[ - _models.ScopeMapUpdateParameters, _types.ScopeMapUpdateParameters, IO[bytes] + private_endpoint_connection_name: str, + private_endpoint_connection: Union[ + _models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes] ], **kwargs: Any - ) -> LROPoller[_models.ScopeMap]: - """Updates a scope map with the specified parameters. + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the container + registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str - :param scope_map_update_parameters: The parameters for updating a scope map. Is either a - ScopeMapUpdateParameters type or a IO[bytes] type. Required. - :type scope_map_update_parameters: - ~azure.mgmt.containerregistry.models.ScopeMapUpdateParameters or - ~azure.mgmt.containerregistry.types.ScopeMapUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The parameters for creating a private endpoint connection. + Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. + :type private_endpoint_connection: + ~azure.mgmt.containerregistry.models.PrivateEndpointConnection or + ~azure.mgmt.containerregistry.types.PrivateEndpointConnection or IO[bytes] + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - scope_map_name=scope_map_name, - scope_map_update_parameters=scope_map_update_parameters, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_connection=private_endpoint_connection, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -10720,7 +6791,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ScopeMap, response.json()) + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -10738,18 +6809,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ScopeMap].from_continuation_token( + return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ScopeMap]( + return LROPoller[_models.PrivateEndpointConnection]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) def _delete_initial( - self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10764,10 +6835,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_scope_maps_delete_request( + _request = build_private_endpoint_connections_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - scope_map_name=scope_map_name, + private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10812,17 +6883,17 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes a scope map from a container registry. + """Deletes the specified private endpoint connection associated with the container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param scope_map_name: The name of the scope map. Required. - :type scope_map_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -10838,7 +6909,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - scope_map_name=scope_map_name, + private_endpoint_connection_name=private_endpoint_connection_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10873,22 +6944,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.ScopeMap"]: - """Lists all the scope maps for the specified container registry. + def list( + self, resource_group_name: str, registry_name: str, **kwargs: Any + ) -> ItemPaged["_models.PrivateEndpointConnection"]: + """List all private endpoint connections in a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of ScopeMap - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.ScopeMap] + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ScopeMap]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10901,7 +6975,7 @@ def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> I def prepare_request(next_link=None): if not next_link: - _request = build_scope_maps_list_request( + _request = build_private_endpoint_connections_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, @@ -10944,7 +7018,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ScopeMap], + List[_models.PrivateEndpointConnection], deserialized.get("value", []), ) if cls: @@ -10973,14 +7047,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class TokensOperations: # pylint: disable=docstring-missing-param +class ReplicationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`tokens` attribute. + :attr:`replications` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -10993,18 +7067,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any) -> _models.Token: - """Gets the properties of the specified token. + def get( + self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any + ) -> _models.Replication: + """Gets the properties of the specified replication. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :return: Token. The Token is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.Token + :param replication_name: The name of the replication. Required. + :type replication_name: str + :return: Replication. The Replication is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.Replication :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11018,12 +7094,12 @@ def get(self, resource_group_name: str, registry_name: str, token_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Token] = kwargs.pop("cls", None) + cls: ClsType[_models.Replication] = kwargs.pop("cls", None) - _request = build_tokens_get_request( + _request = build_replications_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, + replication_name=replication_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11058,7 +7134,7 @@ def get(self, resource_group_name: str, registry_name: str, token_name: str, **k if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Token, response.json()) + deserialized = _deserialize(_models.Replication, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -11069,8 +7145,8 @@ def _create_initial( self, resource_group_name: str, registry_name: str, - token_name: str, - token_create_parameters: Union[_models.Token, _types.Token, IO[bytes]], + replication_name: str, + replication: Union[_models.Replication, _types.Replication, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -11089,15 +7165,15 @@ def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(token_create_parameters, (IOBase, bytes)): - _content = token_create_parameters + if isinstance(replication, (IOBase, bytes)): + _content = replication else: - _content = json.dumps(token_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(replication, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_tokens_create_request( + _request = build_replications_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, + replication_name=replication_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -11149,29 +7225,29 @@ def begin_create( self, resource_group_name: str, registry_name: str, - token_name: str, - token_create_parameters: _models.Token, + replication_name: str, + replication: _models.Replication, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Token]: - """Creates a token for a container registry with the specified parameters. + ) -> LROPoller[_models.Replication]: + """Creates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_create_parameters: The parameters for creating a token. Required. - :type token_create_parameters: ~azure.mgmt.containerregistry.models.Token + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication: The parameters for creating a replication. Required. + :type replication: ~azure.mgmt.containerregistry.models.Replication :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Token. The Token is compatible with + :return: An instance of LROPoller that returns Replication. The Replication is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11180,29 +7256,29 @@ def begin_create( self, resource_group_name: str, registry_name: str, - token_name: str, - token_create_parameters: _types.Token, + replication_name: str, + replication: _types.Replication, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Token]: - """Creates a token for a container registry with the specified parameters. + ) -> LROPoller[_models.Replication]: + """Creates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_create_parameters: The parameters for creating a token. Required. - :type token_create_parameters: ~azure.mgmt.containerregistry.types.Token + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication: The parameters for creating a replication. Required. + :type replication: ~azure.mgmt.containerregistry.types.Replication :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Token. The Token is compatible with + :return: An instance of LROPoller that returns Replication. The Replication is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11211,29 +7287,29 @@ def begin_create( self, resource_group_name: str, registry_name: str, - token_name: str, - token_create_parameters: IO[bytes], + replication_name: str, + replication: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Token]: - """Creates a token for a container registry with the specified parameters. + ) -> LROPoller[_models.Replication]: + """Creates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_create_parameters: The parameters for creating a token. Required. - :type token_create_parameters: IO[bytes] + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication: The parameters for creating a replication. Required. + :type replication: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Token. The Token is compatible with + :return: An instance of LROPoller that returns Replication. The Replication is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11242,33 +7318,33 @@ def begin_create( self, resource_group_name: str, registry_name: str, - token_name: str, - token_create_parameters: Union[_models.Token, _types.Token, IO[bytes]], + replication_name: str, + replication: Union[_models.Replication, _types.Replication, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Token]: - """Creates a token for a container registry with the specified parameters. + ) -> LROPoller[_models.Replication]: + """Creates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_create_parameters: The parameters for creating a token. Is either a Token type or + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication: The parameters for creating a replication. Is either a Replication type or a IO[bytes] type. Required. - :type token_create_parameters: ~azure.mgmt.containerregistry.models.Token or - ~azure.mgmt.containerregistry.types.Token or IO[bytes] - :return: An instance of LROPoller that returns Token. The Token is compatible with + :type replication: ~azure.mgmt.containerregistry.models.Replication or + ~azure.mgmt.containerregistry.types.Replication or IO[bytes] + :return: An instance of LROPoller that returns Replication. The Replication is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Token] = kwargs.pop("cls", None) + cls: ClsType[_models.Replication] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -11276,8 +7352,8 @@ def begin_create( raw_result = self._create_initial( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, - token_create_parameters=token_create_parameters, + replication_name=replication_name, + replication=replication, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -11289,7 +7365,7 @@ def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Token, response.json()) + deserialized = _deserialize(_models.Replication, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -11307,13 +7383,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Token].from_continuation_token( + return LROPoller[_models.Replication].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Token]( + return LROPoller[_models.Replication]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -11321,8 +7397,10 @@ def _update_initial( self, resource_group_name: str, registry_name: str, - token_name: str, - token_update_parameters: Union[_models.TokenUpdateParameters, _types.TokenUpdateParameters, IO[bytes]], + replication_name: str, + replication_update_parameters: Union[ + _models.ReplicationUpdateParameters, _types.ReplicationUpdateParameters, IO[bytes] + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -11341,15 +7419,15 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(token_update_parameters, (IOBase, bytes)): - _content = token_update_parameters + if isinstance(replication_update_parameters, (IOBase, bytes)): + _content = replication_update_parameters else: - _content = json.dumps(token_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(replication_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_tokens_update_request( + _request = build_replications_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, + replication_name=replication_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -11401,29 +7479,30 @@ def begin_update( self, resource_group_name: str, registry_name: str, - token_name: str, - token_update_parameters: _models.TokenUpdateParameters, + replication_name: str, + replication_update_parameters: _models.ReplicationUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Token]: - """Updates a token with the specified parameters. + ) -> LROPoller[_models.Replication]: + """Updates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_update_parameters: The parameters for updating a token. Required. - :type token_update_parameters: ~azure.mgmt.containerregistry.models.TokenUpdateParameters + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication_update_parameters: The parameters for updating a replication. Required. + :type replication_update_parameters: + ~azure.mgmt.containerregistry.models.ReplicationUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Token. The Token is compatible with + :return: An instance of LROPoller that returns Replication. The Replication is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11432,29 +7511,30 @@ def begin_update( self, resource_group_name: str, registry_name: str, - token_name: str, - token_update_parameters: _types.TokenUpdateParameters, + replication_name: str, + replication_update_parameters: _types.ReplicationUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Token]: - """Updates a token with the specified parameters. + ) -> LROPoller[_models.Replication]: + """Updates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_update_parameters: The parameters for updating a token. Required. - :type token_update_parameters: ~azure.mgmt.containerregistry.types.TokenUpdateParameters + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication_update_parameters: The parameters for updating a replication. Required. + :type replication_update_parameters: + ~azure.mgmt.containerregistry.types.ReplicationUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Token. The Token is compatible with + :return: An instance of LROPoller that returns Replication. The Replication is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11463,29 +7543,29 @@ def begin_update( self, resource_group_name: str, registry_name: str, - token_name: str, - token_update_parameters: IO[bytes], + replication_name: str, + replication_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Token]: - """Updates a token with the specified parameters. + ) -> LROPoller[_models.Replication]: + """Updates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_update_parameters: The parameters for updating a token. Required. - :type token_update_parameters: IO[bytes] + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication_update_parameters: The parameters for updating a replication. Required. + :type replication_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Token. The Token is compatible with + :return: An instance of LROPoller that returns Replication. The Replication is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11494,33 +7574,36 @@ def begin_update( self, resource_group_name: str, registry_name: str, - token_name: str, - token_update_parameters: Union[_models.TokenUpdateParameters, _types.TokenUpdateParameters, IO[bytes]], + replication_name: str, + replication_update_parameters: Union[ + _models.ReplicationUpdateParameters, _types.ReplicationUpdateParameters, IO[bytes] + ], **kwargs: Any - ) -> LROPoller[_models.Token]: - """Updates a token with the specified parameters. + ) -> LROPoller[_models.Replication]: + """Updates a replication for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str - :param token_update_parameters: The parameters for updating a token. Is either a - TokenUpdateParameters type or a IO[bytes] type. Required. - :type token_update_parameters: ~azure.mgmt.containerregistry.models.TokenUpdateParameters or - ~azure.mgmt.containerregistry.types.TokenUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns Token. The Token is compatible with + :param replication_name: The name of the replication. Required. + :type replication_name: str + :param replication_update_parameters: The parameters for updating a replication. Is either a + ReplicationUpdateParameters type or a IO[bytes] type. Required. + :type replication_update_parameters: + ~azure.mgmt.containerregistry.models.ReplicationUpdateParameters or + ~azure.mgmt.containerregistry.types.ReplicationUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns Replication. The Replication is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Token] = kwargs.pop("cls", None) + cls: ClsType[_models.Replication] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -11528,8 +7611,8 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, - token_update_parameters=token_update_parameters, + replication_name=replication_name, + replication_update_parameters=replication_update_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -11541,7 +7624,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Token, response.json()) + deserialized = _deserialize(_models.Replication, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -11559,18 +7642,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Token].from_continuation_token( + return LROPoller[_models.Replication].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Token]( + return LROPoller[_models.Replication]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) def _delete_initial( - self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11585,10 +7668,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_tokens_delete_request( + _request = build_replications_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, + replication_name=replication_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11633,17 +7716,17 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, replication_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes a token from a container registry. + """Deletes a replication from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param token_name: The name of the token. Required. - :type token_name: str + :param replication_name: The name of the replication. Required. + :type replication_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -11659,7 +7742,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - token_name=token_name, + replication_name=replication_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -11694,22 +7777,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.Token"]: - """Lists all the tokens for the specified container registry. + def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.Replication"]: + """Lists all the replications for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of Token - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.Token] + :return: An iterator like instance of Replication + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.Replication] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Token]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Replication]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11722,7 +7805,7 @@ def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> I def prepare_request(next_link=None): if not next_link: - _request = build_tokens_list_request( + _request = build_replications_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, @@ -11765,7 +7848,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Token], + List[_models.Replication], deserialized.get("value", []), ) if cls: @@ -11794,14 +7877,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ExportPipelinesOperations: # pylint: disable=docstring-missing-param +class ScopeMapsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`export_pipelines` attribute. + :attr:`scope_maps` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -11814,34 +7897,18 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "export_pipeline_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def get( - self, resource_group_name: str, registry_name: str, export_pipeline_name: str, **kwargs: Any - ) -> _models.ExportPipeline: - """Gets the properties of the export pipeline. + def get(self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any) -> _models.ScopeMap: + """Gets the properties of the specified scope map. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :return: ExportPipeline. The ExportPipeline is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ExportPipeline + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :return: ScopeMap. The ScopeMap is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.ScopeMap :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11855,12 +7922,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ExportPipeline] = kwargs.pop("cls", None) + cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) - _request = build_export_pipelines_get_request( + _request = build_scope_maps_get_request( resource_group_name=resource_group_name, registry_name=registry_name, - export_pipeline_name=export_pipeline_name, + scope_map_name=scope_map_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11895,34 +7962,19 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ExportPipeline, response.json()) + deserialized = _deserialize(_models.ScopeMap, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "export_pipeline_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) def _create_initial( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: Union[_models.ExportPipeline, _types.ExportPipeline, IO[bytes]], + scope_map_name: str, + scope_map_create_parameters: Union[_models.ScopeMap, _types.ScopeMap, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -11941,15 +7993,15 @@ def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(export_pipeline_create_parameters, (IOBase, bytes)): - _content = export_pipeline_create_parameters + if isinstance(scope_map_create_parameters, (IOBase, bytes)): + _content = scope_map_create_parameters else: - _content = json.dumps(export_pipeline_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(scope_map_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_export_pipelines_create_request( + _request = build_scope_maps_create_request( resource_group_name=resource_group_name, registry_name=registry_name, - export_pipeline_name=export_pipeline_name, + scope_map_name=scope_map_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -12001,30 +8053,29 @@ def begin_create( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: _models.ExportPipeline, + scope_map_name: str, + scope_map_create_parameters: _models.ScopeMap, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ExportPipeline]: - """Creates an export pipeline for a container registry with the specified parameters. + ) -> LROPoller[_models.ScopeMap]: + """Creates a scope map for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :param export_pipeline_create_parameters: The parameters for creating an export pipeline. - Required. - :type export_pipeline_create_parameters: ~azure.mgmt.containerregistry.models.ExportPipeline + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_create_parameters: The parameters for creating a scope map. Required. + :type scope_map_create_parameters: ~azure.mgmt.containerregistry.models.ScopeMap :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ExportPipeline. The ExportPipeline is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ExportPipeline] + :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -12033,30 +8084,29 @@ def begin_create( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: _types.ExportPipeline, + scope_map_name: str, + scope_map_create_parameters: _types.ScopeMap, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ExportPipeline]: - """Creates an export pipeline for a container registry with the specified parameters. + ) -> LROPoller[_models.ScopeMap]: + """Creates a scope map for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :param export_pipeline_create_parameters: The parameters for creating an export pipeline. - Required. - :type export_pipeline_create_parameters: ~azure.mgmt.containerregistry.types.ExportPipeline + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_create_parameters: The parameters for creating a scope map. Required. + :type scope_map_create_parameters: ~azure.mgmt.containerregistry.types.ScopeMap :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ExportPipeline. The ExportPipeline is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ExportPipeline] + :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -12065,245 +8115,74 @@ def begin_create( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: IO[bytes], + scope_map_name: str, + scope_map_create_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ExportPipeline]: - """Creates an export pipeline for a container registry with the specified parameters. + ) -> LROPoller[_models.ScopeMap]: + """Creates a scope map for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :param export_pipeline_create_parameters: The parameters for creating an export pipeline. - Required. - :type export_pipeline_create_parameters: IO[bytes] + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_create_parameters: The parameters for creating a scope map. Required. + :type scope_map_create_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ExportPipeline. The ExportPipeline is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ExportPipeline] + :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "export_pipeline_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) def begin_create( self, resource_group_name: str, registry_name: str, - export_pipeline_name: str, - export_pipeline_create_parameters: Union[_models.ExportPipeline, _types.ExportPipeline, IO[bytes]], + scope_map_name: str, + scope_map_create_parameters: Union[_models.ScopeMap, _types.ScopeMap, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ExportPipeline]: - """Creates an export pipeline for a container registry with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :param export_pipeline_create_parameters: The parameters for creating an export pipeline. Is - either a ExportPipeline type or a IO[bytes] type. Required. - :type export_pipeline_create_parameters: ~azure.mgmt.containerregistry.models.ExportPipeline or - ~azure.mgmt.containerregistry.types.ExportPipeline or IO[bytes] - :return: An instance of LROPoller that returns ExportPipeline. The ExportPipeline is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ExportPipeline] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExportPipeline] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - export_pipeline_name=export_pipeline_name, - export_pipeline_create_parameters=export_pipeline_create_parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ExportPipeline, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ExportPipeline].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ExportPipeline]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "export_pipeline_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def _delete_initial( - self, resource_group_name: str, registry_name: str, export_pipeline_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_export_pipelines_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - export_pipeline_name=export_pipeline_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "export_pipeline_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def begin_delete( - self, resource_group_name: str, registry_name: str, export_pipeline_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an export pipeline from a container registry. + ) -> LROPoller[_models.ScopeMap]: + """Creates a scope map for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param export_pipeline_name: The name of the export pipeline. Required. - :type export_pipeline_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :type registry_name: str + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_create_parameters: The parameters for creating a scope map. Is either a + ScopeMap type or a IO[bytes] type. Required. + :type scope_map_create_parameters: ~azure.mgmt.containerregistry.models.ScopeMap or + ~azure.mgmt.containerregistry.types.ScopeMap or IO[bytes] + :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._create_initial( resource_group_name=resource_group_name, registry_name=registry_name, - export_pipeline_name=export_pipeline_name, + scope_map_name=scope_map_name, + scope_map_create_parameters=scope_map_create_parameters, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -12312,9 +8191,12 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ScopeMap, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -12329,251 +8211,24 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.ScopeMap].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": ["api_version", "subscription_id", "resource_group_name", "registry_name", "accept"] - }, - api_versions_list=["2026-10-15-preview"], - ) - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.ExportPipeline"]: - """Lists all export pipelines for the specified container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :return: An iterator like instance of ExportPipeline - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.ExportPipeline] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ExportPipeline]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_export_pipelines_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ExportPipeline], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ImportPipelinesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`import_pipelines` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "import_pipeline_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def get( - self, resource_group_name: str, registry_name: str, import_pipeline_name: str, **kwargs: Any - ) -> _models.ImportPipeline: - """Gets the properties of the import pipeline. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: The name of the container registry. Required. - :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str - :return: ImportPipeline. The ImportPipeline is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.ImportPipeline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ImportPipeline] = kwargs.pop("cls", None) - - _request = build_import_pipelines_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - import_pipeline_name=import_pipeline_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + return LROPoller[_models.ScopeMap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ImportPipeline, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "import_pipeline_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def _create_initial( + def _update_initial( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: Union[_models.ImportPipeline, _types.ImportPipeline, IO[bytes]], + scope_map_name: str, + scope_map_update_parameters: Union[ + _models.ScopeMapUpdateParameters, _types.ScopeMapUpdateParameters, IO[bytes] + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -12592,15 +8247,15 @@ def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(import_pipeline_create_parameters, (IOBase, bytes)): - _content = import_pipeline_create_parameters + if isinstance(scope_map_update_parameters, (IOBase, bytes)): + _content = scope_map_update_parameters else: - _content = json.dumps(import_pipeline_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(scope_map_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_import_pipelines_create_request( + _request = build_scope_maps_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - import_pipeline_name=import_pipeline_name, + scope_map_name=scope_map_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -12648,157 +8303,143 @@ def _create_initial( return deserialized # type: ignore @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: _models.ImportPipeline, + scope_map_name: str, + scope_map_update_parameters: _models.ScopeMapUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ImportPipeline]: - """Creates an import pipeline for a container registry with the specified parameters. + ) -> LROPoller[_models.ScopeMap]: + """Updates a scope map with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str - :param import_pipeline_create_parameters: The parameters for creating an import pipeline. - Required. - :type import_pipeline_create_parameters: ~azure.mgmt.containerregistry.models.ImportPipeline + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_update_parameters: The parameters for updating a scope map. Required. + :type scope_map_update_parameters: + ~azure.mgmt.containerregistry.models.ScopeMapUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ImportPipeline. The ImportPipeline is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ImportPipeline] + :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: _types.ImportPipeline, + scope_map_name: str, + scope_map_update_parameters: _types.ScopeMapUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ImportPipeline]: - """Creates an import pipeline for a container registry with the specified parameters. + ) -> LROPoller[_models.ScopeMap]: + """Updates a scope map with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str - :param import_pipeline_create_parameters: The parameters for creating an import pipeline. - Required. - :type import_pipeline_create_parameters: ~azure.mgmt.containerregistry.types.ImportPipeline + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_update_parameters: The parameters for updating a scope map. Required. + :type scope_map_update_parameters: ~azure.mgmt.containerregistry.types.ScopeMapUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ImportPipeline. The ImportPipeline is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ImportPipeline] + :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: IO[bytes], + scope_map_name: str, + scope_map_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ImportPipeline]: - """Creates an import pipeline for a container registry with the specified parameters. + ) -> LROPoller[_models.ScopeMap]: + """Updates a scope map with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str - :param import_pipeline_create_parameters: The parameters for creating an import pipeline. - Required. - :type import_pipeline_create_parameters: IO[bytes] + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_update_parameters: The parameters for updating a scope map. Required. + :type scope_map_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ImportPipeline. The ImportPipeline is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ImportPipeline] + :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "import_pipeline_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - import_pipeline_name: str, - import_pipeline_create_parameters: Union[_models.ImportPipeline, _types.ImportPipeline, IO[bytes]], + scope_map_name: str, + scope_map_update_parameters: Union[ + _models.ScopeMapUpdateParameters, _types.ScopeMapUpdateParameters, IO[bytes] + ], **kwargs: Any - ) -> LROPoller[_models.ImportPipeline]: - """Creates an import pipeline for a container registry with the specified parameters. + ) -> LROPoller[_models.ScopeMap]: + """Updates a scope map with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str - :param import_pipeline_create_parameters: The parameters for creating an import pipeline. Is - either a ImportPipeline type or a IO[bytes] type. Required. - :type import_pipeline_create_parameters: ~azure.mgmt.containerregistry.models.ImportPipeline or - ~azure.mgmt.containerregistry.types.ImportPipeline or IO[bytes] - :return: An instance of LROPoller that returns ImportPipeline. The ImportPipeline is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ImportPipeline] + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str + :param scope_map_update_parameters: The parameters for updating a scope map. Is either a + ScopeMapUpdateParameters type or a IO[bytes] type. Required. + :type scope_map_update_parameters: + ~azure.mgmt.containerregistry.models.ScopeMapUpdateParameters or + ~azure.mgmt.containerregistry.types.ScopeMapUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns ScopeMap. The ScopeMap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImportPipeline] = kwargs.pop("cls", None) + cls: ClsType[_models.ScopeMap] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - import_pipeline_name=import_pipeline_name, - import_pipeline_create_parameters=import_pipeline_create_parameters, + scope_map_name=scope_map_name, + scope_map_update_parameters=scope_map_update_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -12810,7 +8451,7 @@ def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ImportPipeline, response.json()) + deserialized = _deserialize(_models.ScopeMap, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -12828,31 +8469,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ImportPipeline].from_continuation_token( + return LROPoller[_models.ScopeMap].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ImportPipeline]( + return LROPoller[_models.ScopeMap]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "import_pipeline_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) def _delete_initial( - self, resource_group_name: str, registry_name: str, import_pipeline_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12867,10 +8495,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_import_pipelines_delete_request( + _request = build_scope_maps_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - import_pipeline_name=import_pipeline_name, + scope_map_name=scope_map_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -12914,31 +8542,18 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "import_pipeline_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) def begin_delete( - self, resource_group_name: str, registry_name: str, import_pipeline_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, scope_map_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes an import pipeline from a container registry. + """Deletes a scope map from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param import_pipeline_name: The name of the import pipeline. Required. - :type import_pipeline_name: str + :param scope_map_name: The name of the scope map. Required. + :type scope_map_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -12954,7 +8569,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - import_pipeline_name=import_pipeline_name, + scope_map_name=scope_map_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -12989,29 +8604,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": ["api_version", "subscription_id", "resource_group_name", "registry_name", "accept"] - }, - api_versions_list=["2026-10-15-preview"], - ) - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.ImportPipeline"]: - """Lists all import pipelines for the specified container registry. + def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.ScopeMap"]: + """Lists all the scope maps for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of ImportPipeline - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.ImportPipeline] + :return: An iterator like instance of ScopeMap + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.ScopeMap] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ImportPipeline]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ScopeMap]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13024,7 +8632,7 @@ def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> I def prepare_request(next_link=None): if not next_link: - _request = build_import_pipelines_list_request( + _request = build_scope_maps_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, @@ -13067,7 +8675,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ImportPipeline], + List[_models.ScopeMap], deserialized.get("value", []), ) if cls: @@ -13096,135 +8704,356 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class PipelineRunsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. +class TokensOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s + :attr:`tokens` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerRegistryManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any) -> _models.Token: + """Gets the properties of the specified token. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param token_name: The name of the token. Required. + :type token_name: str + :return: Token. The Token is compatible with MutableMapping + :rtype: ~azure.mgmt.containerregistry.models.Token + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Token] = kwargs.pop("cls", None) + + _request = build_tokens_get_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + token_name=token_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Token, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + registry_name: str, + token_name: str, + token_create_parameters: Union[_models.Token, _types.Token, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(token_create_parameters, (IOBase, bytes)): + _content = token_create_parameters + else: + _content = json.dumps(token_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_tokens_create_request( + resource_group_name=resource_group_name, + registry_name=registry_name, + token_name=token_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + registry_name: str, + token_name: str, + token_create_parameters: _models.Token, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Token]: + """Creates a token for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param token_name: The name of the token. Required. + :type token_name: str + :param token_create_parameters: The parameters for creating a token. Required. + :type token_create_parameters: ~azure.mgmt.containerregistry.models.Token + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + registry_name: str, + token_name: str, + token_create_parameters: _types.Token, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Token]: + """Creates a token for a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param token_name: The name of the token. Required. + :type token_name: str + :param token_create_parameters: The parameters for creating a token. Required. + :type token_create_parameters: ~azure.mgmt.containerregistry.types.Token + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.mgmt.containerregistry.ContainerRegistryManagementClient`'s - :attr:`pipeline_runs` attribute. - """ + @overload + def begin_create( + self, + resource_group_name: str, + registry_name: str, + token_name: str, + token_create_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Token]: + """Creates a token for a container registry with the specified parameters. - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerRegistryManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param registry_name: The name of the container registry. Required. + :type registry_name: str + :param token_name: The name of the token. Required. + :type token_name: str + :param token_create_parameters: The parameters for creating a token. Required. + :type token_create_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "pipeline_run_name", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def get( - self, resource_group_name: str, registry_name: str, pipeline_run_name: str, **kwargs: Any - ) -> _models.PipelineRun: - """Gets the detailed information for a given pipeline run. + def begin_create( + self, + resource_group_name: str, + registry_name: str, + token_name: str, + token_create_parameters: Union[_models.Token, _types.Token, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Token]: + """Creates a token for a container registry with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str - :return: PipelineRun. The PipelineRun is compatible with MutableMapping - :rtype: ~azure.mgmt.containerregistry.models.PipelineRun + :param token_name: The name of the token. Required. + :type token_name: str + :param token_create_parameters: The parameters for creating a token. Is either a Token type or + a IO[bytes] type. Required. + :type token_create_parameters: ~azure.mgmt.containerregistry.models.Token or + ~azure.mgmt.containerregistry.types.Token or IO[bytes] + :return: An instance of LROPoller that returns Token. The Token is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.PipelineRun] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Token] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + token_name=token_name, + token_create_parameters=token_create_parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Token, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_pipeline_runs_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - pipeline_run_name=pipeline_run_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.PipelineRun, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.Token].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Token]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "pipeline_run_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def _create_initial( + def _update_initial( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: Union[_models.PipelineRun, _types.PipelineRun, IO[bytes]], + token_name: str, + token_update_parameters: Union[_models.TokenUpdateParameters, _types.TokenUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -13243,15 +9072,15 @@ def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(pipeline_run_create_parameters, (IOBase, bytes)): - _content = pipeline_run_create_parameters + if isinstance(token_update_parameters, (IOBase, bytes)): + _content = token_update_parameters else: - _content = json.dumps(pipeline_run_create_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(token_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_pipeline_runs_create_request( + _request = build_tokens_update_request( resource_group_name=resource_group_name, registry_name=registry_name, - pipeline_run_name=pipeline_run_name, + token_name=token_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -13299,154 +9128,139 @@ def _create_initial( return deserialized # type: ignore @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: _models.PipelineRun, + token_name: str, + token_update_parameters: _models.TokenUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PipelineRun]: - """Creates a pipeline run for a container registry with the specified parameters. + ) -> LROPoller[_models.Token]: + """Updates a token with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str - :param pipeline_run_create_parameters: The parameters for creating a pipeline run. Required. - :type pipeline_run_create_parameters: ~azure.mgmt.containerregistry.models.PipelineRun + :param token_name: The name of the token. Required. + :type token_name: str + :param token_update_parameters: The parameters for updating a token. Required. + :type token_update_parameters: ~azure.mgmt.containerregistry.models.TokenUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PipelineRun. The PipelineRun is compatible with + :return: An instance of LROPoller that returns Token. The Token is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PipelineRun] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: _types.PipelineRun, + token_name: str, + token_update_parameters: _types.TokenUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PipelineRun]: - """Creates a pipeline run for a container registry with the specified parameters. + ) -> LROPoller[_models.Token]: + """Updates a token with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str - :param pipeline_run_create_parameters: The parameters for creating a pipeline run. Required. - :type pipeline_run_create_parameters: ~azure.mgmt.containerregistry.types.PipelineRun + :param token_name: The name of the token. Required. + :type token_name: str + :param token_update_parameters: The parameters for updating a token. Required. + :type token_update_parameters: ~azure.mgmt.containerregistry.types.TokenUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PipelineRun. The PipelineRun is compatible with + :return: An instance of LROPoller that returns Token. The Token is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PipelineRun] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: IO[bytes], + token_name: str, + token_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PipelineRun]: - """Creates a pipeline run for a container registry with the specified parameters. + ) -> LROPoller[_models.Token]: + """Updates a token with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str - :param pipeline_run_create_parameters: The parameters for creating a pipeline run. Required. - :type pipeline_run_create_parameters: IO[bytes] + :param token_name: The name of the token. Required. + :type token_name: str + :param token_update_parameters: The parameters for updating a token. Required. + :type token_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PipelineRun. The PipelineRun is compatible with + :return: An instance of LROPoller that returns Token. The Token is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PipelineRun] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "pipeline_run_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) - def begin_create( + def begin_update( self, resource_group_name: str, registry_name: str, - pipeline_run_name: str, - pipeline_run_create_parameters: Union[_models.PipelineRun, _types.PipelineRun, IO[bytes]], + token_name: str, + token_update_parameters: Union[_models.TokenUpdateParameters, _types.TokenUpdateParameters, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.PipelineRun]: - """Creates a pipeline run for a container registry with the specified parameters. + ) -> LROPoller[_models.Token]: + """Updates a token with the specified parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str - :param pipeline_run_create_parameters: The parameters for creating a pipeline run. Is either a - PipelineRun type or a IO[bytes] type. Required. - :type pipeline_run_create_parameters: ~azure.mgmt.containerregistry.models.PipelineRun or - ~azure.mgmt.containerregistry.types.PipelineRun or IO[bytes] - :return: An instance of LROPoller that returns PipelineRun. The PipelineRun is compatible with + :param token_name: The name of the token. Required. + :type token_name: str + :param token_update_parameters: The parameters for updating a token. Is either a + TokenUpdateParameters type or a IO[bytes] type. Required. + :type token_update_parameters: ~azure.mgmt.containerregistry.models.TokenUpdateParameters or + ~azure.mgmt.containerregistry.types.TokenUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns Token. The Token is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.PipelineRun] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PipelineRun] = kwargs.pop("cls", None) + cls: ClsType[_models.Token] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, registry_name=registry_name, - pipeline_run_name=pipeline_run_name, - pipeline_run_create_parameters=pipeline_run_create_parameters, + token_name=token_name, + token_update_parameters=token_update_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -13458,7 +9272,7 @@ def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.PipelineRun, response.json()) + deserialized = _deserialize(_models.Token, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -13476,31 +9290,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.PipelineRun].from_continuation_token( + return LROPoller[_models.Token].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PipelineRun]( + return LROPoller[_models.Token]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "pipeline_run_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) def _delete_initial( - self, resource_group_name: str, registry_name: str, pipeline_run_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13515,10 +9316,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_pipeline_runs_delete_request( + _request = build_tokens_delete_request( resource_group_name=resource_group_name, registry_name=registry_name, - pipeline_run_name=pipeline_run_name, + token_name=token_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -13562,31 +9363,18 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "registry_name", - "pipeline_run_name", - ] - }, - api_versions_list=["2026-10-15-preview"], - ) def begin_delete( - self, resource_group_name: str, registry_name: str, pipeline_run_name: str, **kwargs: Any + self, resource_group_name: str, registry_name: str, token_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes a pipeline run from a container registry. + """Deletes a token from a container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :param pipeline_run_name: The name of the pipeline run. Required. - :type pipeline_run_name: str + :param token_name: The name of the token. Required. + :type token_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -13602,7 +9390,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, - pipeline_run_name=pipeline_run_name, + token_name=token_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -13637,29 +9425,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-10-15-preview", - params_added_on={ - "2026-10-15-preview": ["api_version", "subscription_id", "resource_group_name", "registry_name", "accept"] - }, - api_versions_list=["2026-10-15-preview"], - ) - def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.PipelineRun"]: - """Lists all the pipeline runs for the specified container registry. + def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> ItemPaged["_models.Token"]: + """Lists all the tokens for the specified container registry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param registry_name: The name of the container registry. Required. :type registry_name: str - :return: An iterator like instance of PipelineRun - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.PipelineRun] + :return: An iterator like instance of Token + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerregistry.models.Token] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.PipelineRun]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Token]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13672,7 +9453,7 @@ def list(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> I def prepare_request(next_link=None): if not next_link: - _request = build_pipeline_runs_list_request( + _request = build_tokens_list_request( resource_group_name=resource_group_name, registry_name=registry_name, subscription_id=self._config.subscription_id, @@ -13715,7 +9496,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.PipelineRun], + List[_models.Token], deserialized.get("value", []), ) if cls: diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/types.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/types.py index d5f927b48ee6..892d82fae977 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/types.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/types.py @@ -7,19 +7,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Literal, TYPE_CHECKING, Union +from typing import Any, TYPE_CHECKING, Union from typing_extensions import Required, TypedDict -from .models._enums import AdditionalAuthenticationType - if TYPE_CHECKING: from .models import ( Action, ActionsRequired, ActivationStatus, AuditLogStatus, - AuthType, - AutoGeneratedDomainNameLabelScope, AzureADAuthenticationAsArmPolicyStatus, CertificateType, ConnectedRegistryMode, @@ -35,15 +31,8 @@ ExportPolicyStatus, ImportMode, LogLevel, - ManagedServiceIdentityType, - MetadataSearch, NetworkRuleBypassOptions, - PackageSourceType, PasswordName, - PipelineOptions, - PipelineRunSourceType, - PipelineRunTargetType, - PipelineSourceType, PolicyStatus, ProvisioningState, PublicNetworkAccess, @@ -52,18 +41,13 @@ RoleAssignmentMode, SkuName, SkuTier, - StorageAccessMode, - SyncState, - SyncTrigger, TlsStatus, TokenCertificateName, TokenPasswordName, TokenStatus, - TriggerStatus, TrustPolicyType, WebhookAction, WebhookStatus, - WritableCacheRepos, ZoneRedundancy, ) @@ -80,6 +64,42 @@ class ActivationProperties(TypedDict, total=False): """The activation status of the connected registry. Known values are: \"Active\" and \"Inactive\".""" +class AuthCredential(TypedDict, total=False): + """Authentication credential stored for an upstream. + + :ivar name: The name of the credential. "Credential1" + :vartype name: Union[str, "CredentialName"] + :ivar usernameSecretIdentifier: KeyVault Secret URI for accessing the username. + :vartype usernameSecretIdentifier: str + :ivar passwordSecretIdentifier: KeyVault Secret URI for accessing the password. + :vartype passwordSecretIdentifier: str + :ivar credentialHealth: This provides data pertaining to the health of the auth credential. + :vartype credentialHealth: "CredentialHealth" + """ + + name: Union[str, "CredentialName"] + """The name of the credential. \"Credential1\"""" + usernameSecretIdentifier: str + """KeyVault Secret URI for accessing the username.""" + passwordSecretIdentifier: str + """KeyVault Secret URI for accessing the password.""" + credentialHealth: "CredentialHealth" + """This provides data pertaining to the health of the auth credential.""" + + +class AzureADAuthenticationAsArmPolicy(TypedDict, total=False): + """The policy for using Azure Resource Manager audience token for a container registry. + + :ivar status: The value that indicates whether the policy is enabled or not. Known values are: + "enabled" and "disabled". + :vartype status: Union[str, "AzureADAuthenticationAsArmPolicyStatus"] + """ + + status: Union[str, "AzureADAuthenticationAsArmPolicyStatus"] + """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\" + and \"disabled\".""" + + class Resource(TypedDict, total=False): """Resource. @@ -125,129 +145,6 @@ class ProxyResource(Resource): """ -class Archive(ProxyResource): - """An object that represents a archive for a container registry. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the private link resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: The properties of the archive. - :vartype properties: "ArchiveProperties" - """ - - properties: "ArchiveProperties" - """The properties of the archive.""" - - -class ArchivePackageSourceProperties(TypedDict, total=False): - """The properties of the archive package source. - - :ivar type: The type of package source for a archive. "remote" - :vartype type: Union[str, "PackageSourceType"] - :ivar url: The external repository url. - :vartype url: str - """ - - type: Union[str, "PackageSourceType"] - """The type of package source for a archive. \"remote\"""" - url: str - """The external repository url.""" - - -class ArchiveProperties(TypedDict, total=False): - """The properties of a archive. - - :ivar packageSource: The package source of the archive. - :vartype packageSource: "ArchivePackageSourceProperties" - :ivar publishedVersion: The published version of the archive. - :vartype publishedVersion: str - :ivar repositoryEndpointPrefix: - :vartype repositoryEndpointPrefix: str - :ivar repositoryEndpoint: - :vartype repositoryEndpoint: str - :ivar provisioningState: The provisioning state of the archive at the time the operation was - called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and - "Canceled". - :vartype provisioningState: Union[str, "ProvisioningState"] - """ - - packageSource: "ArchivePackageSourceProperties" - """The package source of the archive.""" - publishedVersion: str - """The published version of the archive.""" - repositoryEndpointPrefix: str - repositoryEndpoint: str - provisioningState: Union[str, "ProvisioningState"] - """The provisioning state of the archive at the time the operation was called. Known values are: - \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - - -class ArchiveUpdateParameters(TypedDict, total=False): - """The parameters for updating a archive. - - :ivar properties: The properties of the connected registry update parameters. - :vartype properties: "ArchiveUpdateProperties" - """ - - properties: "ArchiveUpdateProperties" - """The properties of the connected registry update parameters.""" - - -class ArchiveUpdateProperties(TypedDict, total=False): - """The properties of a archive. - - :ivar publishedVersion: The published version of the archive. - :vartype publishedVersion: str - """ - - publishedVersion: str - """The published version of the archive.""" - - -class AuthCredential(TypedDict, total=False): - """Authentication credential stored for an upstream. - - :ivar name: The name of the credential. "Credential1" - :vartype name: Union[str, "CredentialName"] - :ivar usernameSecretIdentifier: KeyVault Secret URI for accessing the username. - :vartype usernameSecretIdentifier: str - :ivar passwordSecretIdentifier: KeyVault Secret URI for accessing the password. - :vartype passwordSecretIdentifier: str - :ivar credentialHealth: This provides data pertaining to the health of the auth credential. - :vartype credentialHealth: "CredentialHealth" - """ - - name: Union[str, "CredentialName"] - """The name of the credential. \"Credential1\"""" - usernameSecretIdentifier: str - """KeyVault Secret URI for accessing the username.""" - passwordSecretIdentifier: str - """KeyVault Secret URI for accessing the password.""" - credentialHealth: "CredentialHealth" - """This provides data pertaining to the health of the auth credential.""" - - -class AzureADAuthenticationAsArmPolicy(TypedDict, total=False): - """The policy for using Azure Resource Manager audience token for a container registry. - - :ivar status: The value that indicates whether the policy is enabled or not. Known values are: - "enabled" and "disabled". - :vartype status: Union[str, "AzureADAuthenticationAsArmPolicyStatus"] - """ - - status: Union[str, "AzureADAuthenticationAsArmPolicyStatus"] - """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\" - and \"disabled\".""" - - class CacheRule(ProxyResource): """An object that represents a cache rule for a container registry. @@ -264,14 +161,10 @@ class CacheRule(ProxyResource): :vartype systemData: "SystemData" :ivar properties: The properties of the cache rule. :vartype properties: "CacheRuleProperties" - :ivar identity: The identity of the cache rule. - :vartype identity: "IdentityProperties" """ properties: "CacheRuleProperties" """The properties of the cache rule.""" - identity: "IdentityProperties" - """The identity of the cache rule.""" class CacheRuleProperties(TypedDict, total=False): @@ -280,9 +173,6 @@ class CacheRuleProperties(TypedDict, total=False): :ivar credentialSetResourceId: The ARM resource ID of the credential store which is associated with the cache rule. :vartype credentialSetResourceId: str - :ivar additionalAuthenticationProperties: Authentication configuration used by the cache rule - to access the upstream source repository. - :vartype additionalAuthenticationProperties: "AdditionalAuthenticationProperties" :ivar sourceRepository: Source repository pulled from upstream. :vartype sourceRepository: str :ivar targetRepository: Target repository specified in docker pull command. Eg: docker pull @@ -297,8 +187,6 @@ class CacheRuleProperties(TypedDict, total=False): credentialSetResourceId: str """The ARM resource ID of the credential store which is associated with the cache rule.""" - additionalAuthenticationProperties: "AdditionalAuthenticationProperties" - """Authentication configuration used by the cache rule to access the upstream source repository.""" sourceRepository: str """Source repository pulled from upstream.""" targetRepository: str @@ -316,14 +204,10 @@ class CacheRuleUpdateParameters(TypedDict, total=False): :ivar properties: The properties of the cache rule update parameters. :vartype properties: "CacheRuleUpdateProperties" - :ivar identity: The identity of the cache rule. - :vartype identity: "IdentityProperties" """ properties: "CacheRuleUpdateProperties" """The properties of the cache rule update parameters.""" - identity: "IdentityProperties" - """The identity of the cache rule.""" class CacheRuleUpdateProperties(TypedDict, total=False): @@ -332,20 +216,10 @@ class CacheRuleUpdateProperties(TypedDict, total=False): :ivar credentialSetResourceId: The ARM resource ID of the credential store which is associated with the Cache rule. :vartype credentialSetResourceId: str - :ivar additionalAuthenticationProperties: Authentication configuration used by the cache rule - to access the upstream source repository. Omitted fields retain their current values. When - authentication is first configured, all required fields of the selected authentication type - must be supplied. Changing an existing authentication type is not supported. - :vartype additionalAuthenticationProperties: "AdditionalAuthenticationUpdateProperties" """ credentialSetResourceId: str """The ARM resource ID of the credential store which is associated with the Cache rule.""" - additionalAuthenticationProperties: "AdditionalAuthenticationUpdateProperties" - """Authentication configuration used by the cache rule to access the upstream source repository. - Omitted fields retain their current values. When authentication is first configured, all - required fields of the selected authentication type must be supplied. Changing an existing - authentication type is not supported.""" class ConnectedRegistry(ProxyResource): @@ -364,17 +238,10 @@ class ConnectedRegistry(ProxyResource): :vartype systemData: "SystemData" :ivar properties: The properties of the connected registry. :vartype properties: "ConnectedRegistryProperties" - :ivar identity: The user-assigned managed identity used by the on-prem connected registry to - authenticate with the cloud registry for sync operations. Requires authType to be - ManagedIdentity. - :vartype identity: "ManagedServiceIdentity" """ properties: "ConnectedRegistryProperties" """The properties of the connected registry.""" - identity: "ManagedServiceIdentity" - """The user-assigned managed identity used by the on-prem connected registry to authenticate with - the cloud registry for sync operations. Requires authType to be ManagedIdentity.""" class ConnectedRegistryProperties(TypedDict, total=False): @@ -411,9 +278,6 @@ class ConnectedRegistryProperties(TypedDict, total=False): :vartype notificationsList: list[str] :ivar garbageCollection: The garbage collection properties of the connected registry. :vartype garbageCollection: "GarbageCollectionProperties" - :ivar registrySyncResult: The result of the connected registry's most recent sync with its - parent. - :vartype registrySyncResult: "RegistrySyncResult" """ provisioningState: Union[str, "ProvisioningState"] @@ -445,8 +309,6 @@ class ConnectedRegistryProperties(TypedDict, total=False): """The list of notifications subscription information for the connected registry.""" garbageCollection: "GarbageCollectionProperties" """The garbage collection properties of the connected registry.""" - registrySyncResult: "RegistrySyncResult" - """The result of the connected registry's most recent sync with its parent.""" class ConnectedRegistryUpdateParameters(TypedDict, total=False): @@ -454,16 +316,10 @@ class ConnectedRegistryUpdateParameters(TypedDict, total=False): :ivar properties: The properties of the connected registry update parameters. :vartype properties: "ConnectedRegistryUpdateProperties" - :ivar identity: The user-assigned managed identity used to authenticate the connected registry - with its parent during synchronization. Requires authType to be ManagedIdentity. - :vartype identity: "ManagedServiceIdentity" """ properties: "ConnectedRegistryUpdateProperties" """The properties of the connected registry update parameters.""" - identity: "ManagedServiceIdentity" - """The user-assigned managed identity used to authenticate the connected registry with its parent - during synchronization. Requires authType to be ManagedIdentity.""" class ConnectedRegistryUpdateProperties(TypedDict, total=False): @@ -597,122 +453,6 @@ class CredentialSetUpdateProperties(TypedDict, total=False): optional secondary credential.""" -class EcrAuthenticationProperties(TypedDict, total=False): - """Amazon Elastic Container Registry (ECR) authentication configuration. - - :ivar authenticationType: Required. Amazon Elastic Container Registry (ECR) authentication via - workload identity federation. - :vartype authenticationType: - Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY] - :ivar accountNumber: The AWS account that owns the IAM role used for authentication. The IAM - role is assumed via AWS Security Token Service (STS) when exchanging a federated Entra access - token for an ECR access token. The full IAM role ARN is derived from ``accountNumber``, - ``rolePath``, and ``roleName`` as ``arn:aws:iam::{accountNumber}:role{rolePath}{roleName}`` - (the initial path defaults to ``/``). Required. - :vartype accountNumber: str - :ivar region: The AWS region of the upstream Elastic Container Registry (e.g. ``us-west-2``). - Only commercial AWS regions are supported; the GovCloud (``us-gov-*``), China (``cn-*``), and - Secret/Top Secret ISO (``us-iso*``) partitions are rejected. The pattern stays - forward-compatible for new commercial regions without requiring a contract change. Required. - :vartype region: str - :ivar roleName: The name of the AWS IAM role assumed for authentication. This is the role name - only, not the full ARN; the IAM path is supplied separately via ``rolePath``, so '/' is not - permitted here. Required. - :vartype roleName: str - :ivar rolePath: Optional IAM path of the role (for example ``/team/`` or ``/division/team/``). - The value must be supplied in canonical form with a leading and trailing '/'; it is validated - as-is and is never normalized. A non-root path must contain at least one character between the - surrounding slashes. When authentication is first configured, an omitted path defaults to the - root (``/``). When updating an existing authentication configuration, an omitted path retains - its current value. - :vartype rolePath: str - """ - - authenticationType: Required[Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY]] - """Required. Amazon Elastic Container Registry (ECR) authentication via workload identity - federation.""" - accountNumber: Required[str] - """The AWS account that owns the IAM role used for authentication. The IAM role is assumed via AWS - Security Token Service (STS) when exchanging a federated Entra access token for an ECR access - token. The full IAM role ARN is derived from ``accountNumber``, ``rolePath``, and ``roleName`` - as ``arn:aws:iam::{accountNumber}:role{rolePath}{roleName}`` (the initial path defaults to - ``/``). Required.""" - region: Required[str] - """The AWS region of the upstream Elastic Container Registry (e.g. ``us-west-2``). Only commercial - AWS regions are supported; the GovCloud (``us-gov-*``), China (``cn-*``), and Secret/Top Secret - ISO (``us-iso*``) partitions are rejected. The pattern stays forward-compatible for new - commercial regions without requiring a contract change. Required.""" - roleName: Required[str] - """The name of the AWS IAM role assumed for authentication. This is the role name only, not the - full ARN; the IAM path is supplied separately via ``rolePath``, so '/' is not permitted here. - Required.""" - rolePath: str - """Optional IAM path of the role (for example ``/team/`` or ``/division/team/``). The value must - be supplied in canonical form with a leading and trailing '/'; it is validated as-is and is - never normalized. A non-root path must contain at least one character between the surrounding - slashes. When authentication is first configured, an omitted path defaults to the root (``/``). - When updating an existing authentication configuration, an omitted path retains its current - value.""" - - -class EcrAuthenticationUpdateProperties(TypedDict, total=False): - """Partial Amazon Elastic Container Registry (ECR) authentication configuration. When - authentication is first configured, accountNumber, region, and roleName must be supplied. - - :ivar authenticationType: Required. Amazon Elastic Container Registry (ECR) authentication via - workload identity federation. - :vartype authenticationType: - Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY] - :ivar accountNumber: The AWS account that owns the IAM role used for authentication. The IAM - role is assumed via AWS Security Token Service (STS) when exchanging a federated Entra access - token for an ECR access token. The full IAM role ARN is derived from ``accountNumber``, - ``rolePath``, and ``roleName`` as ``arn:aws:iam::{accountNumber}:role{rolePath}{roleName}`` - (the initial path defaults to ``/``). - :vartype accountNumber: str - :ivar region: The AWS region of the upstream Elastic Container Registry (e.g. ``us-west-2``). - Only commercial AWS regions are supported; the GovCloud (``us-gov-*``), China (``cn-*``), and - Secret/Top Secret ISO (``us-iso*``) partitions are rejected. The pattern stays - forward-compatible for new commercial regions without requiring a contract change. - :vartype region: str - :ivar roleName: The name of the AWS IAM role assumed for authentication. This is the role name - only, not the full ARN; the IAM path is supplied separately via ``rolePath``, so '/' is not - permitted here. - :vartype roleName: str - :ivar rolePath: Optional IAM path of the role (for example ``/team/`` or ``/division/team/``). - The value must be supplied in canonical form with a leading and trailing '/'; it is validated - as-is and is never normalized. A non-root path must contain at least one character between the - surrounding slashes. When authentication is first configured, an omitted path defaults to the - root (``/``). When updating an existing authentication configuration, an omitted path retains - its current value. - :vartype rolePath: str - """ - - authenticationType: Required[Literal[AdditionalAuthenticationType.AWS_ELASTIC_CONTAINER_REGISTRY]] - """Required. Amazon Elastic Container Registry (ECR) authentication via workload identity - federation.""" - accountNumber: str - """The AWS account that owns the IAM role used for authentication. The IAM role is assumed via AWS - Security Token Service (STS) when exchanging a federated Entra access token for an ECR access - token. The full IAM role ARN is derived from ``accountNumber``, ``rolePath``, and ``roleName`` - as ``arn:aws:iam::{accountNumber}:role{rolePath}{roleName}`` (the initial path defaults to - ``/``).""" - region: str - """The AWS region of the upstream Elastic Container Registry (e.g. ``us-west-2``). Only commercial - AWS regions are supported; the GovCloud (``us-gov-*``), China (``cn-*``), and Secret/Top Secret - ISO (``us-iso*``) partitions are rejected. The pattern stays forward-compatible for new - commercial regions without requiring a contract change.""" - roleName: str - """The name of the AWS IAM role assumed for authentication. This is the role name only, not the - full ARN; the IAM path is supplied separately via ``rolePath``, so '/' is not permitted here.""" - rolePath: str - """Optional IAM path of the role (for example ``/team/`` or ``/division/team/``). The value must - be supplied in canonical form with a leading and trailing '/'; it is validated as-is and is - never normalized. A non-root path must contain at least one character between the surrounding - slashes. When authentication is first configured, an omitted path defaults to the root (``/``). - When updating an existing authentication configuration, an omitted path retains its current - value.""" - - class EncryptionProperty(TypedDict, total=False): """EncryptionProperty. @@ -730,159 +470,6 @@ class EncryptionProperty(TypedDict, total=False): """Key vault properties.""" -class EntraFederatedIdentityCredentialAuthenticationProperties(TypedDict, total=False): # pylint: disable=name-too-long - """Microsoft Entra federated identity credential authentication configuration. - - :ivar authenticationType: Required. Microsoft Entra authentication via a federated identity - credential on an application in another tenant. - :vartype authenticationType: - Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL] - :ivar sourceTenantId: The upstream tenant that issues the token for - ``federatedApplicationClientId`` and contains the application's enterprise application (service - principal). Required. - :vartype sourceTenantId: str - :ivar federatedApplicationClientId: The client ID of the multi-tenant application. Its - application registration and federated identity credential must be in the cache rule managed - identity's home tenant. The credential's subject is the managed identity's principal/object ID, - not its client ID. Its enterprise application (service principal) must exist in - ``sourceTenantId``. Required. - :vartype federatedApplicationClientId: str - """ - - authenticationType: Required[Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL]] - """Required. Microsoft Entra authentication via a federated identity credential on an application - in another tenant.""" - sourceTenantId: Required[str] - """The upstream tenant that issues the token for ``federatedApplicationClientId`` and contains the - application's enterprise application (service principal). Required.""" - federatedApplicationClientId: Required[str] - """The client ID of the multi-tenant application. Its application registration and federated - identity credential must be in the cache rule managed identity's home tenant. The credential's - subject is the managed identity's principal/object ID, not its client ID. Its enterprise - application (service principal) must exist in ``sourceTenantId``. Required.""" - - -class EntraFederatedIdentityCredentialAuthenticationUpdateProperties( - TypedDict, total=False -): # pylint: disable=name-too-long - """Partial Microsoft Entra federated identity credential authentication configuration. When - authentication is first configured, sourceTenantId and federatedApplicationClientId must be - supplied. - - :ivar authenticationType: Required. Microsoft Entra authentication via a federated identity - credential on an application in another tenant. - :vartype authenticationType: - Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL] - :ivar sourceTenantId: The upstream tenant that issues the token for - ``federatedApplicationClientId`` and contains the application's enterprise application (service - principal). - :vartype sourceTenantId: str - :ivar federatedApplicationClientId: The client ID of the multi-tenant application. Its - application registration and federated identity credential must be in the cache rule managed - identity's home tenant. The credential's subject is the managed identity's principal/object ID, - not its client ID. Its enterprise application (service principal) must exist in - ``sourceTenantId``. - :vartype federatedApplicationClientId: str - """ - - authenticationType: Required[Literal[AdditionalAuthenticationType.ENTRA_FEDERATED_IDENTITY_CREDENTIAL]] - """Required. Microsoft Entra authentication via a federated identity credential on an application - in another tenant.""" - sourceTenantId: str - """The upstream tenant that issues the token for ``federatedApplicationClientId`` and contains the - application's enterprise application (service principal).""" - federatedApplicationClientId: str - """The client ID of the multi-tenant application. Its application registration and federated - identity credential must be in the cache rule managed identity's home tenant. The credential's - subject is the managed identity's principal/object ID, not its client ID. Its enterprise - application (service principal) must exist in ``sourceTenantId``.""" - - -class ExportPipeline(ProxyResource): - """An object that represents an export pipeline for a container registry. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the private link resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: The properties of the export pipeline. - :vartype properties: "ExportPipelineProperties" - :ivar location: The location of the export pipeline. - :vartype location: str - :ivar identity: The identity of the export pipeline. - :vartype identity: "IdentityProperties" - """ - - properties: "ExportPipelineProperties" - """The properties of the export pipeline.""" - location: str - """The location of the export pipeline.""" - identity: "IdentityProperties" - """The identity of the export pipeline.""" - - -class ExportPipelineProperties(TypedDict, total=False): - """The properties of an export pipeline. - - :ivar target: The target properties of the export pipeline. Required. - :vartype target: "ExportPipelineTargetProperties" - :ivar options: The list of all options configured for the pipeline. - :vartype options: list[Union[str, "PipelineOptions"]] - :ivar provisioningState: The provisioning state of the pipeline at the time the operation was - called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and - "Canceled". - :vartype provisioningState: Union[str, "ProvisioningState"] - """ - - target: Required["ExportPipelineTargetProperties"] - """The target properties of the export pipeline. Required.""" - options: list[Union[str, "PipelineOptions"]] - """The list of all options configured for the pipeline.""" - provisioningState: Union[str, "ProvisioningState"] - """The provisioning state of the pipeline at the time the operation was called. Known values are: - \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - - -class ExportPipelineTargetProperties(TypedDict, total=False): - """The properties of the export pipeline target. - - :ivar type: The type of target for the export pipeline. - :vartype type: str - :ivar uri: 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 - `_". - :vartype uri: str - :ivar keyVaultUri: They key vault secret uri to obtain the target storage SAS token. - :vartype keyVaultUri: str - :ivar storageAccessMode: The storage access mode used for the customer storage account. Known - values are: "ManagedIdentity" and "SasToken". - :vartype storageAccessMode: Union[str, "StorageAccessMode"] - """ - - type: str - """The type of target for the export pipeline.""" - uri: str - """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 - `_\".""" - keyVaultUri: str - """They key vault secret uri to obtain the target storage SAS token.""" - storageAccessMode: Union[str, "StorageAccessMode"] - """The storage access mode used for the customer storage account. Known values are: - \"ManagedIdentity\" and \"SasToken\".""" - - class ExportPolicy(TypedDict, total=False): """The export policy for a container registry. @@ -896,70 +483,6 @@ class ExportPolicy(TypedDict, total=False): and \"disabled\".""" -class GarAuthenticationProperties(TypedDict, total=False): - """Google Artifact Registry (GAR) authentication configuration. - - :ivar authenticationType: Required. Google Artifact Registry (GAR) authentication via workload - identity federation. - :vartype authenticationType: Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY] - :ivar projectNumber: The Google Cloud Platform project that is configured for authentication - Permissions should be granted to - principal://iam.googleapis.com/projects/{ProjectNumber}/locations/global/workloadIdentityPools/{WorkloadIdentityPool}/providers/{WorkloadIdentityProvider}/subject/{ManagedIdentityPrincipal}. - Required. - :vartype projectNumber: str - :ivar workloadIdentityPool: The Google Cloud platform workload identity pool used for - authentication. Required. - :vartype workloadIdentityPool: str - :ivar workloadIdentityProvider: The Google Cloud Platform workload identity provider used for - authentication. Required. - :vartype workloadIdentityProvider: str - """ - - authenticationType: Required[Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY]] - """Required. Google Artifact Registry (GAR) authentication via workload identity federation.""" - projectNumber: Required[str] - """The Google Cloud Platform project that is configured for authentication Permissions should be - granted to - principal://iam.googleapis.com/projects/{ProjectNumber}/locations/global/workloadIdentityPools/{WorkloadIdentityPool}/providers/{WorkloadIdentityProvider}/subject/{ManagedIdentityPrincipal}. - Required.""" - workloadIdentityPool: Required[str] - """The Google Cloud platform workload identity pool used for authentication. Required.""" - workloadIdentityProvider: Required[str] - """The Google Cloud Platform workload identity provider used for authentication. Required.""" - - -class GarAuthenticationUpdateProperties(TypedDict, total=False): - """Partial Google Artifact Registry (GAR) authentication configuration. When authentication is - first configured, projectNumber, workloadIdentityPool, and workloadIdentityProvider must be - supplied. - - :ivar authenticationType: Required. Google Artifact Registry (GAR) authentication via workload - identity federation. - :vartype authenticationType: Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY] - :ivar projectNumber: The Google Cloud Platform project that is configured for authentication - Permissions should be granted to - principal://iam.googleapis.com/projects/{ProjectNumber}/locations/global/workloadIdentityPools/{WorkloadIdentityPool}/providers/{WorkloadIdentityProvider}/subject/{ManagedIdentityPrincipal}. - :vartype projectNumber: str - :ivar workloadIdentityPool: The Google Cloud platform workload identity pool used for - authentication. - :vartype workloadIdentityPool: str - :ivar workloadIdentityProvider: The Google Cloud Platform workload identity provider used for - authentication. - :vartype workloadIdentityProvider: str - """ - - authenticationType: Required[Literal[AdditionalAuthenticationType.GOOGLE_ARTIFACT_REGISTRY]] - """Required. Google Artifact Registry (GAR) authentication via workload identity federation.""" - projectNumber: str - """The Google Cloud Platform project that is configured for authentication Permissions should be - granted to - principal://iam.googleapis.com/projects/{ProjectNumber}/locations/global/workloadIdentityPools/{WorkloadIdentityPool}/providers/{WorkloadIdentityProvider}/subject/{ManagedIdentityPrincipal}.""" - workloadIdentityPool: str - """The Google Cloud platform workload identity pool used for authentication.""" - workloadIdentityProvider: str - """The Google Cloud Platform workload identity provider used for authentication.""" - - class GarbageCollectionProperties(TypedDict, total=False): """The garbage collection properties of the connected registry. @@ -1061,95 +584,6 @@ class ImportImageParameters(TypedDict, total=False): \"Force\".""" -class ImportPipeline(ProxyResource): - """An object that represents an import pipeline for a container registry. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the private link resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: The properties of the import pipeline. - :vartype properties: "ImportPipelineProperties" - :ivar location: The location of the import pipeline. - :vartype location: str - :ivar identity: The identity of the import pipeline. - :vartype identity: "IdentityProperties" - """ - - properties: "ImportPipelineProperties" - """The properties of the import pipeline.""" - location: str - """The location of the import pipeline.""" - identity: "IdentityProperties" - """The identity of the import pipeline.""" - - -class ImportPipelineProperties(TypedDict, total=False): - """The properties of an import pipeline. - - :ivar source: The source properties of the import pipeline. Required. - :vartype source: "ImportPipelineSourceProperties" - :ivar trigger: The properties that describe the trigger of the import pipeline. - :vartype trigger: "PipelineTriggerProperties" - :ivar options: The list of all options configured for the pipeline. - :vartype options: list[Union[str, "PipelineOptions"]] - :ivar provisioningState: The provisioning state of the pipeline at the time the operation was - called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and - "Canceled". - :vartype provisioningState: Union[str, "ProvisioningState"] - """ - - source: Required["ImportPipelineSourceProperties"] - """The source properties of the import pipeline. Required.""" - trigger: "PipelineTriggerProperties" - """The properties that describe the trigger of the import pipeline.""" - options: list[Union[str, "PipelineOptions"]] - """The list of all options configured for the pipeline.""" - provisioningState: Union[str, "ProvisioningState"] - """The provisioning state of the pipeline at the time the operation was called. Known values are: - \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - - -class ImportPipelineSourceProperties(TypedDict, total=False): - """The properties of the import pipeline source. - - :ivar type: The type of source for the import pipeline. "AzureStorageBlobContainer" - :vartype type: Union[str, "PipelineSourceType"] - :ivar uri: 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 - `_". - :vartype uri: str - :ivar keyVaultUri: They key vault secret uri to obtain the source storage SAS token. - :vartype keyVaultUri: str - :ivar storageAccessMode: The storage access mode used for the customer storage account. Known - values are: "ManagedIdentity" and "SasToken". - :vartype storageAccessMode: Union[str, "StorageAccessMode"] - """ - - type: Union[str, "PipelineSourceType"] - """The type of source for the import pipeline. \"AzureStorageBlobContainer\"""" - uri: str - """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 - `_\".""" - keyVaultUri: str - """They key vault secret uri to obtain the source storage SAS token.""" - storageAccessMode: Union[str, "StorageAccessMode"] - """The storage access mode used for the customer storage account. Known values are: - \"ManagedIdentity\" and \"SasToken\".""" - - class ImportSource(TypedDict, total=False): """ImportSource. @@ -1272,35 +706,6 @@ class LoginServerProperties(TypedDict, total=False): """The TLS properties of the connected registry login server.""" -class ManagedServiceIdentity(TypedDict, total=False): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar principalId: The service principal ID of the system assigned identity. This property will - only be provided for a system assigned identity. - :vartype principalId: str - :ivar tenantId: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenantId: str - :ivar type: The type of managed identity assigned to this resource. Required. Known values are: - "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: Union[str, "ManagedServiceIdentityType"] - :ivar userAssignedIdentities: The identities assigned to this resource by the user. - :vartype userAssignedIdentities: dict[str, "UserAssignedIdentity"] - """ - - principalId: str - """The service principal ID of the system assigned identity. This property will only be provided - for a system assigned identity.""" - tenantId: str - """The tenant ID of the system assigned identity. This property will only be provided for a system - assigned identity.""" - type: Required[Union[str, "ManagedServiceIdentityType"]] - """The type of managed identity assigned to this resource. Required. Known values are: \"None\", - \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - userAssignedIdentities: dict[str, "UserAssignedIdentity"] - """The identities assigned to this resource by the user.""" - - class NetworkRuleSet(TypedDict, total=False): """The network rule set for a container registry. @@ -1337,212 +742,6 @@ class ParentProperties(TypedDict, total=False): """The sync properties of the connected registry with its parent. Required.""" -class PipelineRun(ProxyResource): - """An object that represents a pipeline run for a container registry. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the private link resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: The properties of a pipeline run. - :vartype properties: "PipelineRunProperties" - """ - - properties: "PipelineRunProperties" - """The properties of a pipeline run.""" - - -class PipelineRunProperties(TypedDict, total=False): - """The properties of a pipeline run. - - :ivar provisioningState: The provisioning state of a pipeline run. Known values are: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioningState: Union[str, "ProvisioningState"] - :ivar request: The request parameters for a pipeline run. - :vartype request: "PipelineRunRequest" - :ivar response: The response of a pipeline run. - :vartype response: "PipelineRunResponse" - :ivar forceUpdateTag: How the pipeline run should be forced to recreate even if the pipeline - run configuration has not changed. - :vartype forceUpdateTag: str - """ - - provisioningState: Union[str, "ProvisioningState"] - """The provisioning state of a pipeline run. Known values are: \"Creating\", \"Updating\", - \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - request: "PipelineRunRequest" - """The request parameters for a pipeline run.""" - response: "PipelineRunResponse" - """The response of a pipeline run.""" - forceUpdateTag: str - """How the pipeline run should be forced to recreate even if the pipeline run configuration has - not changed.""" - - -class PipelineRunRequest(TypedDict, total=False): - """The request properties provided for a pipeline run. - - :ivar pipelineResourceId: The resource ID of the pipeline to run. - :vartype pipelineResourceId: str - :ivar artifacts: 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'). - :vartype artifacts: list[str] - :ivar source: The source properties of the pipeline run. - :vartype source: "PipelineRunSourceProperties" - :ivar target: The target properties of the pipeline run. - :vartype target: "PipelineRunTargetProperties" - :ivar catalogDigest: The digest of the tar used to transfer the artifacts. - :vartype catalogDigest: str - """ - - pipelineResourceId: str - """The resource ID of the pipeline to run.""" - artifacts: list[str] - """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').""" - source: "PipelineRunSourceProperties" - """The source properties of the pipeline run.""" - target: "PipelineRunTargetProperties" - """The target properties of the pipeline run.""" - catalogDigest: str - """The digest of the tar used to transfer the artifacts.""" - - -class PipelineRunResponse(TypedDict, total=False): - """The response properties returned for a pipeline run. - - :ivar status: The current status of the pipeline run. - :vartype status: str - :ivar importedArtifacts: The artifacts imported in the pipeline run. - :vartype importedArtifacts: list[str] - :ivar progress: The current progress of the copy operation. - :vartype progress: "ProgressProperties" - :ivar startTime: The time the pipeline run started. - :vartype startTime: str - :ivar finishTime: The time the pipeline run finished. - :vartype finishTime: str - :ivar source: The source of the pipeline run. - :vartype source: "ImportPipelineSourceProperties" - :ivar target: The target of the pipeline run. - :vartype target: "ExportPipelineTargetProperties" - :ivar catalogDigest: The digest of the tar used to transfer the artifacts. - :vartype catalogDigest: str - :ivar trigger: The trigger that caused the pipeline run. - :vartype trigger: "PipelineTriggerDescriptor" - :ivar pipelineRunErrorMessage: The detailed error message for the pipeline run in the case of - failure. - :vartype pipelineRunErrorMessage: str - """ - - status: str - """The current status of the pipeline run.""" - importedArtifacts: list[str] - """The artifacts imported in the pipeline run.""" - progress: "ProgressProperties" - """The current progress of the copy operation.""" - startTime: str - """The time the pipeline run started.""" - finishTime: str - """The time the pipeline run finished.""" - source: "ImportPipelineSourceProperties" - """The source of the pipeline run.""" - target: "ExportPipelineTargetProperties" - """The target of the pipeline run.""" - catalogDigest: str - """The digest of the tar used to transfer the artifacts.""" - trigger: "PipelineTriggerDescriptor" - """The trigger that caused the pipeline run.""" - pipelineRunErrorMessage: str - """The detailed error message for the pipeline run in the case of failure.""" - - -class PipelineRunSourceProperties(TypedDict, total=False): - """The pipeline run source properties. - - :ivar type: The type of the source. "AzureStorageBlob" - :vartype type: Union[str, "PipelineRunSourceType"] - :ivar name: The name of the source. - :vartype name: str - """ - - type: Union[str, "PipelineRunSourceType"] - """The type of the source. \"AzureStorageBlob\"""" - name: str - """The name of the source.""" - - -class PipelineRunTargetProperties(TypedDict, total=False): - """The pipeline run target properties. - - :ivar type: The type of the target. "AzureStorageBlob" - :vartype type: Union[str, "PipelineRunTargetType"] - :ivar name: The name of the target. - :vartype name: str - """ - - type: Union[str, "PipelineRunTargetType"] - """The type of the target. \"AzureStorageBlob\"""" - name: str - """The name of the target.""" - - -class PipelineSourceTriggerDescriptor(TypedDict, total=False): - """The pipeline source trigger descriptor. - - :ivar timestamp: The timestamp when the source update happened. - :vartype timestamp: str - """ - - timestamp: str - """The timestamp when the source update happened.""" - - -class PipelineSourceTriggerProperties(TypedDict, total=False): - """The source trigger properties of the import pipeline. - - :ivar status: The current status of the source trigger. Required. Known values are: "Enabled" - and "Disabled". - :vartype status: Union[str, "TriggerStatus"] - """ - - status: Required[Union[str, "TriggerStatus"]] - """The current status of the source trigger. Required. Known values are: \"Enabled\" and - \"Disabled\".""" - - -class PipelineTriggerDescriptor(TypedDict, total=False): - """The pipeline trigger descriptor. - - :ivar sourceTrigger: The source trigger that caused the pipeline run. - :vartype sourceTrigger: "PipelineSourceTriggerDescriptor" - """ - - sourceTrigger: "PipelineSourceTriggerDescriptor" - """The source trigger that caused the pipeline run.""" - - -class PipelineTriggerProperties(TypedDict, total=False): - """The trigger properties of the import pipeline. - - :ivar sourceTrigger: The source trigger properties of the pipeline. - :vartype sourceTrigger: "PipelineSourceTriggerProperties" - """ - - sourceTrigger: "PipelineSourceTriggerProperties" - """The source trigger properties of the pipeline.""" - - class Policies(TypedDict, total=False): """The policies for a container registry. @@ -1557,8 +756,6 @@ class Policies(TypedDict, total=False): :ivar azureADAuthenticationAsArmPolicy: The policy for using Azure Resource Manager audience token for a container registry. :vartype azureADAuthenticationAsArmPolicy: "AzureADAuthenticationAsArmPolicy" - :ivar softDeletePolicy: The soft delete policy for a container registry. - :vartype softDeletePolicy: "SoftDeletePolicy" """ quarantinePolicy: "QuarantinePolicy" @@ -1571,8 +768,6 @@ class Policies(TypedDict, total=False): """The export policy for a container registry.""" azureADAuthenticationAsArmPolicy: "AzureADAuthenticationAsArmPolicy" """The policy for using Azure Resource Manager audience token for a container registry.""" - softDeletePolicy: "SoftDeletePolicy" - """The soft delete policy for a container registry.""" class PrivateEndpoint(TypedDict, total=False): @@ -1656,17 +851,6 @@ class PrivateLinkServiceConnectionState(TypedDict, total=False): Known values are: \"None\" and \"Recreate\".""" -class ProgressProperties(TypedDict, total=False): - """The progress properties. - - :ivar percentage: The percentage complete of the copy operation. - :vartype percentage: str - """ - - percentage: str - """The percentage complete of the copy operation.""" - - class QuarantinePolicy(TypedDict, total=False): """The quarantine policy for a container registry. @@ -1761,12 +945,6 @@ class RegistryNameCheckRequest(TypedDict, total=False): :ivar type: The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. Required. "Microsoft.ContainerRegistry/registries" :vartype type: Union[str, "ContainerRegistryResourceType"] - :ivar resourceGroupName: The resource group name of the container registry. - :vartype resourceGroupName: str - :ivar autoGeneratedDomainNameLabelScope: The auto generated domain name label of the container - registry. This value defaults to "Unsecure". Known values are: "Unsecure", "TenantReuse", - "SubscriptionReuse", "ResourceGroupReuse", and "NoReuse". - :vartype autoGeneratedDomainNameLabelScope: Union[str, "AutoGeneratedDomainNameLabelScope"] """ name: Required[str] @@ -1774,12 +952,6 @@ class RegistryNameCheckRequest(TypedDict, total=False): type: Required[Union[str, "ContainerRegistryResourceType"]] """The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. Required. \"Microsoft.ContainerRegistry/registries\"""" - resourceGroupName: str - """The resource group name of the container registry.""" - autoGeneratedDomainNameLabelScope: Union[str, "AutoGeneratedDomainNameLabelScope"] - """The auto generated domain name label of the container registry. This value defaults to - \"Unsecure\". Known values are: \"Unsecure\", \"TenantReuse\", \"SubscriptionReuse\", - \"ResourceGroupReuse\", and \"NoReuse\".""" class RegistryProperties(TypedDict, total=False): @@ -1834,16 +1006,6 @@ class RegistryProperties(TypedDict, total=False): :vartype zoneRedundancy: Union[str, "ZoneRedundancy"] :ivar anonymousPullEnabled: Enables registry-wide pull from unauthenticated clients. :vartype anonymousPullEnabled: bool - :ivar metadataSearch: Determines whether registry artifacts are indexed for metadata search. - Known values are: "Enabled" and "Disabled". - :vartype metadataSearch: Union[str, "MetadataSearch"] - :ivar autoGeneratedDomainNameLabelScope: Determines the domain name label reuse scope. Known - values are: "Unsecure", "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and - "NoReuse". - :vartype autoGeneratedDomainNameLabelScope: Union[str, "AutoGeneratedDomainNameLabelScope"] - :ivar writableCacheRepos: Whether to allow cache operations that write to repositories in this - registry. Known values are: "Enabled" and "Disabled". - :vartype writableCacheRepos: Union[str, "WritableCacheRepos"] :ivar roleAssignmentMode: Determines registry role assignment mode. Known values are: "AbacRepositoryPermissions" and "LegacyRegistryPermissions". :vartype roleAssignmentMode: Union[str, "RoleAssignmentMode"] @@ -1894,15 +1056,6 @@ class RegistryProperties(TypedDict, total=False): \"Enabled\" and \"Disabled\".""" anonymousPullEnabled: bool """Enables registry-wide pull from unauthenticated clients.""" - metadataSearch: Union[str, "MetadataSearch"] - """Determines whether registry artifacts are indexed for metadata search. Known values are: - \"Enabled\" and \"Disabled\".""" - autoGeneratedDomainNameLabelScope: Union[str, "AutoGeneratedDomainNameLabelScope"] - """Determines the domain name label reuse scope. Known values are: \"Unsecure\", \"TenantReuse\", - \"SubscriptionReuse\", \"ResourceGroupReuse\", and \"NoReuse\".""" - writableCacheRepos: Union[str, "WritableCacheRepos"] - """Whether to allow cache operations that write to repositories in this registry. Known values - are: \"Enabled\" and \"Disabled\".""" roleAssignmentMode: Union[str, "RoleAssignmentMode"] """Determines registry role assignment mode. Known values are: \"AbacRepositoryPermissions\" and \"LegacyRegistryPermissions\".""" @@ -1938,12 +1091,6 @@ class RegistryPropertiesUpdateParameters(TypedDict, total=False): :vartype networkRuleBypassAllowedForTasks: bool :ivar anonymousPullEnabled: Enables registry-wide pull from unauthenticated clients. :vartype anonymousPullEnabled: bool - :ivar metadataSearch: Determines whether registry artifacts are indexed for metadata search. - Known values are: "Enabled" and "Disabled". - :vartype metadataSearch: Union[str, "MetadataSearch"] - :ivar writableCacheRepos: Whether to allow cache operations that write to repositories in this - registry. Known values are: "Enabled" and "Disabled". - :vartype writableCacheRepos: Union[str, "WritableCacheRepos"] :ivar roleAssignmentMode: Determines registry role assignment mode. Known values are: "AbacRepositoryPermissions" and "LegacyRegistryPermissions". :vartype roleAssignmentMode: Union[str, "RoleAssignmentMode"] @@ -1975,49 +1122,11 @@ class RegistryPropertiesUpdateParameters(TypedDict, total=False): """Whether to allow ACR Tasks service to access a network restricted registry.""" anonymousPullEnabled: bool """Enables registry-wide pull from unauthenticated clients.""" - metadataSearch: Union[str, "MetadataSearch"] - """Determines whether registry artifacts are indexed for metadata search. Known values are: - \"Enabled\" and \"Disabled\".""" - writableCacheRepos: Union[str, "WritableCacheRepos"] - """Whether to allow cache operations that write to repositories in this registry. Known values - are: \"Enabled\" and \"Disabled\".""" roleAssignmentMode: Union[str, "RoleAssignmentMode"] """Determines registry role assignment mode. Known values are: \"AbacRepositoryPermissions\" and \"LegacyRegistryPermissions\".""" -class RegistrySyncResult(TypedDict, total=False): - """The registry sync result of the connected registry. - - :ivar syncTrigger: The action that triggered the most recent registry sync. Required. Known - values are: "SyncTokenUpdate", "InitialSync", "ManualResync", and "RecoveryService". - :vartype syncTrigger: Union[str, "SyncTrigger"] - :ivar syncState: The status of the connected registry's most recent sync. Required. Known - values are: "NotActivated", "Syncing", "Failed", "Succeeded", "TimedOut", and "Pending". - :vartype syncState: Union[str, "SyncState"] - :ivar lastSyncStartTime: The time that the connected registry's most recent sync started. - :vartype lastSyncStartTime: str - :ivar lastSyncEndTime: The time that the connected registry's most recent sync ended. - :vartype lastSyncEndTime: str - :ivar lastSuccessfulSyncEndTime: The time that the connected registry's most recent successful - sync ended. - :vartype lastSuccessfulSyncEndTime: str - """ - - syncTrigger: Required[Union[str, "SyncTrigger"]] - """The action that triggered the most recent registry sync. Required. Known values are: - \"SyncTokenUpdate\", \"InitialSync\", \"ManualResync\", and \"RecoveryService\".""" - syncState: Required[Union[str, "SyncState"]] - """The status of the connected registry's most recent sync. Required. Known values are: - \"NotActivated\", \"Syncing\", \"Failed\", \"Succeeded\", \"TimedOut\", and \"Pending\".""" - lastSyncStartTime: str - """The time that the connected registry's most recent sync started.""" - lastSyncEndTime: str - """The time that the connected registry's most recent sync ended.""" - lastSuccessfulSyncEndTime: str - """The time that the connected registry's most recent successful sync ended.""" - - class RegistryUpdateParameters(TypedDict, total=False): """The parameters for updating a container registry. @@ -2252,27 +1361,6 @@ class Sku(TypedDict, total=False): \"Premium\".""" -class SoftDeletePolicy(TypedDict, total=False): - """The soft delete policy for a container registry. - - :ivar retentionDays: The number of days after which a soft-deleted item is permanently deleted. - :vartype retentionDays: int - :ivar lastUpdatedTime: The timestamp when the policy was last updated. - :vartype lastUpdatedTime: str - :ivar status: The value that indicates whether the policy is enabled or not. Known values are: - "enabled" and "disabled". - :vartype status: Union[str, "PolicyStatus"] - """ - - retentionDays: int - """The number of days after which a soft-deleted item is permanently deleted.""" - lastUpdatedTime: str - """The timestamp when the policy was last updated.""" - status: Union[str, "PolicyStatus"] - """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\" - and \"disabled\".""" - - class Status(TypedDict, total=False): """The status of an Azure resource at the time the operation was called. @@ -2305,10 +1393,6 @@ class StatusDetailProperties(TypedDict, total=False): :vartype timestamp: str :ivar correlationId: The correlation ID of the status. :vartype correlationId: str - :ivar totalGib: The total disk space in gibibytes (Gib, base-2). - :vartype totalGib: float - :ivar availableGib: The available disk space in gibibytes (Gib, base-2). - :vartype availableGib: float """ type: str @@ -2321,10 +1405,6 @@ class StatusDetailProperties(TypedDict, total=False): """The timestamp of the status.""" correlationId: str """The correlation ID of the status.""" - totalGib: float - """The total disk space in gibibytes (Gib, base-2).""" - availableGib: float - """The available disk space in gibibytes (Gib, base-2).""" class SyncProperties(TypedDict, total=False): @@ -2349,9 +1429,6 @@ class SyncProperties(TypedDict, total=False): :ivar gatewayEndpoint: The gateway endpoint used by the connected registry to communicate with its parent. :vartype gatewayEndpoint: str - :ivar authType: The authentication type used for the connected registry to sync with its - parent. Known values are: "SyncToken" and "ManagedIdentity". - :vartype authType: Union[str, "AuthType"] """ tokenId: str @@ -2370,9 +1447,6 @@ class SyncProperties(TypedDict, total=False): """The last time a sync occurred between the connected registry and its parent.""" gatewayEndpoint: str """The gateway endpoint used by the connected registry to communicate with its parent.""" - authType: Union[str, "AuthType"] - """The authentication type used for the connected registry to sync with its parent. Known values - are: \"SyncToken\" and \"ManagedIdentity\".""" class SyncUpdateProperties(TypedDict, total=False): @@ -2387,9 +1461,6 @@ class SyncUpdateProperties(TypedDict, total=False): :ivar messageTtl: 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. :vartype messageTtl: str - :ivar authType: The authentication type used for the connected registry to sync with its - parent. Known values are: "SyncToken" and "ManagedIdentity". - :vartype authType: Union[str, "AuthType"] """ schedule: str @@ -2401,9 +1472,6 @@ class SyncUpdateProperties(TypedDict, total=False): messageTtl: str """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.""" - authType: Union[str, "AuthType"] - """The authentication type used for the connected registry to sync with its parent. Known values - are: \"SyncToken\" and \"ManagedIdentity\".""" class SystemData(TypedDict, total=False): @@ -2638,21 +1706,6 @@ class TrustPolicy(TypedDict, total=False): and \"disabled\".""" -class UserAssignedIdentity(TypedDict, total=False): - """User assigned identity properties. - - :ivar principalId: The principal ID of the assigned identity. - :vartype principalId: str - :ivar clientId: The client ID of the assigned identity. - :vartype clientId: str - """ - - principalId: str - """The principal ID of the assigned identity.""" - clientId: str - """The client ID of the assigned identity.""" - - class UserIdentityProperties(TypedDict, total=False): """UserIdentityProperties. @@ -2786,13 +1839,3 @@ class WebhookUpdateParameters(TypedDict, total=False): """The tags for the webhook.""" properties: "WebhookPropertiesUpdateParameters" """The properties that the webhook will be updated with.""" - - -AdditionalAuthenticationProperties = Union[ - EcrAuthenticationProperties, EntraFederatedIdentityCredentialAuthenticationProperties, GarAuthenticationProperties -] -AdditionalAuthenticationUpdateProperties = Union[ - EcrAuthenticationUpdateProperties, - EntraFederatedIdentityCredentialAuthenticationUpdateProperties, - GarAuthenticationUpdateProperties, -] diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_create.py deleted file mode 100644 index 36cec9e08de7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_create.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python archive_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.archives.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - package_type="rpm", - archive_name="myArchiveName", - archive_create_parameters={ - "properties": { - "packageSource": {"type": "remote", "url": "string"}, - "publishedVersion": "string", - "repositoryEndpointPrefix": "string", - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ArchiveCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_delete.py deleted file mode 100644 index 956d7152bbe1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_delete.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python archive_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.archives.begin_delete( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - package_type="myPackageType", - archive_name="myArchiveName", - ).result() - - -# x-ms-original-file: 2026-10-15-preview/ArchiveDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_get.py deleted file mode 100644 index 300c70854acb..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_get.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python archive_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.archives.get( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - package_type="myPackageType", - archive_name="myArchiveName", - ) - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ArchiveGet.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_list.py deleted file mode 100644 index ef247be8cc30..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_list.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python archive_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.archives.list( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - package_type="myPackageType", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-10-15-preview/ArchiveList.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_update.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_update.py deleted file mode 100644 index bb7944d09522..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_update.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python archive_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.archives.update( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - package_type="myPackageType", - archive_name="myArchiveName", - archive_update_parameters={"properties": {"publishedVersion": "string"}}, - ) - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ArchiveUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_create.py deleted file mode 100644 index df310ef8d5c7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_create.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python archive_version_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.archive_versions.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - package_type="rpm", - archive_name="myArchiveName", - archive_version_name="myArchiveVersionName", - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ArchiveVersionCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_delete.py deleted file mode 100644 index 20e771616e14..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_delete.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python archive_version_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.archive_versions.begin_delete( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - package_type="myPackageType", - archive_name="myArchiveName", - archive_version_name="myArchiveVersionName", - ).result() - - -# x-ms-original-file: 2026-10-15-preview/ArchiveVersionDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_get.py deleted file mode 100644 index e02830990957..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_get.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python archive_version_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.archive_versions.get( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - package_type="rpm", - archive_name="myArchiveName", - archive_version_name="myArchiveVersionName", - ) - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ArchiveVersionGet.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_list.py deleted file mode 100644 index 164cd7b609f1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/archive_version_list.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python archive_version_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.archive_versions.list( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - package_type="myPackageType", - archive_name="myArchiveName", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-10-15-preview/ArchiveVersionList.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create.py index 6b81eeb4620c..dfe5ccfc27af 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/CacheRuleCreate.json +# x-ms-original-file: 2026-11-01/CacheRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_authentication.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_authentication.py deleted file mode 100644 index fd7a0cc0f948..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_authentication.py +++ /dev/null @@ -1,56 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python cache_rule_create_user_assigned_mi_authentication.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_rules.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - cache_rule_name="myCacheRule", - cache_rule_create_parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity": {} - }, - }, - "properties": { - "sourceRepository": "acr-registry.azurecr.io/library/repository", - "targetRepository": "cached-acr/hello-world", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/CacheRuleCreateUserAssignedMIAuthentication.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_aws.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_aws.py deleted file mode 100644 index d7e0f46ac7b8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_aws.py +++ /dev/null @@ -1,63 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python cache_rule_create_user_assigned_mi_aws.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_rules.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - cache_rule_name="myCacheRule", - cache_rule_create_parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity": {} - }, - }, - "properties": { - "additionalAuthenticationProperties": { - "accountNumber": "123456789012", - "authenticationType": "AwsElasticContainerRegistry", - "region": "us-west-2", - "roleName": "my-ecr-pull-role", - "rolePath": "/acr/", - }, - "sourceRepository": "123456789012.dkr.ecr.us-west-2.amazonaws.com/hello-world", - "targetRepository": "cached-ecr/hello-world", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/CacheRuleCreateUserAssignedMIAws.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_entra_federated_identity_credential.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_entra_federated_identity_credential.py deleted file mode 100644 index 70b00efc4a35..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_entra_federated_identity_credential.py +++ /dev/null @@ -1,61 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python cache_rule_create_user_assigned_mi_entra_federated_identity_credential.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_rules.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - cache_rule_name="myCacheRule", - cache_rule_create_parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity": {} - }, - }, - "properties": { - "additionalAuthenticationProperties": { - "authenticationType": "EntraFederatedIdentityCredential", - "federatedApplicationClientId": "abcdef12-3456-7890-abcd-ef1234567890", - "sourceTenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", - }, - "sourceRepository": "myupstream.azurecr.io/hello-world", - "targetRepository": "cached-upstream/hello-world", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/CacheRuleCreateUserAssignedMIEntraFederatedIdentityCredential.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_google.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_google.py deleted file mode 100644 index e929616aa6e8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_create_user_assigned_mi_google.py +++ /dev/null @@ -1,62 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python cache_rule_create_user_assigned_mi_google.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_rules.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - cache_rule_name="myCacheRule", - cache_rule_create_parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity": {} - }, - }, - "properties": { - "additionalAuthenticationProperties": { - "authenticationType": "GoogleArtifactRegistry", - "projectNumber": "123456789012", - "workloadIdentityPool": "my-workload-identity-pool", - "workloadIdentityProvider": "my-workload-identity-provider", - }, - "sourceRepository": "us-west1-docker.pkg.dev/repository/hello-world", - "targetRepository": "cached-acr/hello-world", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/CacheRuleCreateUserAssignedMIGoogle.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_delete.py index 65103828d570..f5375138f0d3 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_delete.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/CacheRuleDelete.json +# x-ms-original-file: 2026-11-01/CacheRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_get.py index 033d3c0dfe20..331b5bca36d1 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_get.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/CacheRuleGet.json +# x-ms-original-file: 2026-11-01/CacheRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_list.py index 48f790a20c75..dfdd2ceb2062 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_list.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/CacheRuleList.json +# x-ms-original-file: 2026-11-01/CacheRuleList.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update.py index 9f336eb1afd0..2c4555d22fbc 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/CacheRuleUpdate.json +# x-ms-original-file: 2026-11-01/CacheRuleUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_aws_authentication.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_aws_authentication.py deleted file mode 100644 index c4746bd4f8bb..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_aws_authentication.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python cache_rule_update_aws_authentication.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_rules.begin_update( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - cache_rule_name="myCacheRule", - cache_rule_update_parameters={ - "properties": { - "additionalAuthenticationProperties": { - "authenticationType": "AwsElasticContainerRegistry", - "roleName": "updated-ecr-pull-role", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/CacheRuleUpdateAwsAuthentication.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_configure_aws_authentication.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_configure_aws_authentication.py deleted file mode 100644 index 158fc9d8794f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_configure_aws_authentication.py +++ /dev/null @@ -1,60 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python cache_rule_update_configure_aws_authentication.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_rules.begin_update( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - cache_rule_name="myCacheRule", - cache_rule_update_parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity": {} - }, - }, - "properties": { - "additionalAuthenticationProperties": { - "accountNumber": "123456789012", - "authenticationType": "AwsElasticContainerRegistry", - "region": "us-west-2", - "roleName": "my-ecr-pull-role", - } - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/CacheRuleUpdateConfigureAwsAuthentication.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_configure_entra_authentication.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_configure_entra_authentication.py deleted file mode 100644 index 1ca298eae267..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_configure_entra_authentication.py +++ /dev/null @@ -1,59 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python cache_rule_update_configure_entra_authentication.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_rules.begin_update( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - cache_rule_name="myCacheRule", - cache_rule_update_parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity": {} - }, - }, - "properties": { - "additionalAuthenticationProperties": { - "authenticationType": "EntraFederatedIdentityCredential", - "federatedApplicationClientId": "abcdef12-3456-7890-abcd-ef1234567890", - "sourceTenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", - } - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/CacheRuleUpdateConfigureEntraAuthentication.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_configure_google_authentication.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_configure_google_authentication.py deleted file mode 100644 index 83bf55899c4f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_configure_google_authentication.py +++ /dev/null @@ -1,60 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python cache_rule_update_configure_google_authentication.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_rules.begin_update( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - cache_rule_name="myCacheRule", - cache_rule_update_parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity": {} - }, - }, - "properties": { - "additionalAuthenticationProperties": { - "authenticationType": "GoogleArtifactRegistry", - "projectNumber": "123456789012", - "workloadIdentityPool": "my-workload-identity-pool", - "workloadIdentityProvider": "my-workload-identity-provider", - } - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/CacheRuleUpdateConfigureGoogleAuthentication.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_entra_authentication.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_entra_authentication.py deleted file mode 100644 index eccd8d1fc435..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_entra_authentication.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python cache_rule_update_entra_authentication.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_rules.begin_update( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - cache_rule_name="myCacheRule", - cache_rule_update_parameters={ - "properties": { - "additionalAuthenticationProperties": { - "authenticationType": "EntraFederatedIdentityCredential", - "federatedApplicationClientId": "fedcba98-7654-3210-abcd-ef1234567890", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/CacheRuleUpdateEntraAuthentication.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_google_authentication.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_google_authentication.py deleted file mode 100644 index e91a8947c490..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/cache_rule_update_google_authentication.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python cache_rule_update_google_authentication.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_rules.begin_update( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - cache_rule_name="myCacheRule", - cache_rule_update_parameters={ - "properties": { - "additionalAuthenticationProperties": { - "authenticationType": "GoogleArtifactRegistry", - "workloadIdentityProvider": "updated-identity-provider", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/CacheRuleUpdateGoogleAuthentication.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_create.py index 831514ec5ab3..53e37747408d 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_create.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_create.py @@ -57,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/ConnectedRegistryCreate.json +# x-ms-original-file: 2026-11-01/ConnectedRegistryCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_create_managed_identity.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_create_managed_identity.py deleted file mode 100644 index 0da74d9d54a6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_create_managed_identity.py +++ /dev/null @@ -1,68 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python connected_registry_create_managed_identity.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.connected_registries.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - connected_registry_name="myConnectedRegistry", - connected_registry_create_parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity": {} - }, - }, - "properties": { - "clientTokenIds": [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token" - ], - "garbageCollection": {"enabled": True, "schedule": "0 5 * * *"}, - "mode": "ReadWrite", - "notificationsList": ["hello-world:*:*", "sample/repo/*:1.0:*"], - "parent": { - "syncProperties": { - "authType": "ManagedIdentity", - "messageTtl": "P2D", - "schedule": "0 9 * * *", - "syncWindow": "PT3H", - } - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ConnectedRegistryCreateManagedIdentity.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_deactivate.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_deactivate.py index 3a46d1128357..dfc476f17457 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_deactivate.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_deactivate.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/ConnectedRegistryDeactivate.json +# x-ms-original-file: 2026-11-01/ConnectedRegistryDeactivate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_delete.py index f3030007df41..e1a6dcfaf59c 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_delete.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/ConnectedRegistryDelete.json +# x-ms-original-file: 2026-11-01/ConnectedRegistryDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_get.py index db72c891c9a2..8d44ec0eb963 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_get.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/ConnectedRegistryGet.json +# x-ms-original-file: 2026-11-01/ConnectedRegistryGet.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_list.py index 5fa94f3d0dac..e1460e57626f 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_list.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/ConnectedRegistryList.json +# x-ms-original-file: 2026-11-01/ConnectedRegistryList.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_resync.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_resync.py deleted file mode 100644 index d48f221516ad..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_resync.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python connected_registry_resync.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.connected_registries.resync( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - connected_registry_name="myConnectedRegistry", - ) - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ConnectedRegistryResync.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_update.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_update.py index 8a18f8d59a79..813680b443cf 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_update.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_update.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/ConnectedRegistryUpdate.json +# x-ms-original-file: 2026-11-01/ConnectedRegistryUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_update_managed_identity.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_update_managed_identity.py deleted file mode 100644 index bb5b79062141..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/connected_registry_update_managed_identity.py +++ /dev/null @@ -1,67 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python connected_registry_update_managed_identity.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.connected_registries.begin_update( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - connected_registry_name="myConnectedRegistry", - connected_registry_update_parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity": {} - }, - }, - "properties": { - "clientTokenIds": [ - "/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", - ], - "garbageCollection": {"enabled": True, "schedule": "0 5 * * *"}, - "logging": {"auditLogStatus": "Enabled", "logLevel": "Debug"}, - "notificationsList": ["hello-world:*:*", "sample/repo/*:1.0:*"], - "syncProperties": { - "authType": "ManagedIdentity", - "messageTtl": "P30D", - "schedule": "0 0 */10 * *", - "syncWindow": "P2D", - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ConnectedRegistryUpdateManagedIdentity.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_create.py index 89966de0e50b..e49300695a6c 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_create.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_create.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/CredentialSetCreate.json +# x-ms-original-file: 2026-11-01/CredentialSetCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_delete.py index 5ce80361262d..7980d4d2c161 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_delete.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/CredentialSetDelete.json +# x-ms-original-file: 2026-11-01/CredentialSetDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_get.py index 7eea8df9fc1a..57fea109d7c8 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_get.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/CredentialSetGet.json +# x-ms-original-file: 2026-11-01/CredentialSetGet.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_list.py index 3f4a6185bba8..8c40cdc2e7c4 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_list.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/CredentialSetList.json +# x-ms-original-file: 2026-11-01/CredentialSetList.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_update.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_update.py index 454a6c0437e9..00e751d7d3fd 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_update.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/credential_set_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/CredentialSetUpdate.json +# x-ms-original-file: 2026-11-01/CredentialSetUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_create.py deleted file mode 100644 index 72d9b6b340fe..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_create.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python export_pipeline_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.export_pipelines.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - export_pipeline_name="myExportPipeline", - export_pipeline_create_parameters={ - "identity": {"type": "SystemAssigned"}, - "location": "westus", - "properties": { - "options": ["OverwriteBlobs"], - "target": { - "keyVaultUri": "https://myvault.vault.azure.net/secrets/acrexportsas", - "storageAccessMode": "SasToken", - "type": "AzureStorageBlobContainer", - "uri": "https://accountname.blob.core.windows.net/containername", - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ExportPipelineCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_delete.py deleted file mode 100644 index 280879632e62..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python export_pipeline_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.export_pipelines.begin_delete( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - export_pipeline_name="myExportPipeline", - ).result() - - -# x-ms-original-file: 2026-10-15-preview/ExportPipelineDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_get.py deleted file mode 100644 index b1709c63f209..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python export_pipeline_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.export_pipelines.get( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - export_pipeline_name="myExportPipeline", - ) - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ExportPipelineGet.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_list.py deleted file mode 100644 index f43bde7ed926..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/export_pipeline_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python export_pipeline_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.export_pipelines.list( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-10-15-preview/ExportPipelineList.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_by_manifest_digest.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_by_manifest_digest.py index 02c4b14f7b9f..fa9044a1268b 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_by_manifest_digest.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_by_manifest_digest.py @@ -46,6 +46,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/ImportImageByManifestDigest.json +# x-ms-original-file: 2026-11-01/ImportImageByManifestDigest.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_by_tag.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_by_tag.py index 6fdefc31431d..55d7cf1cb43c 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_by_tag.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_by_tag.py @@ -46,6 +46,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/ImportImageByTag.json +# x-ms-original-file: 2026-11-01/ImportImageByTag.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_from_public_registry.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_from_public_registry.py index 4c26314bc2e9..8268fc9d0ca4 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_from_public_registry.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_image_from_public_registry.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/ImportImageFromPublicRegistry.json +# x-ms-original-file: 2026-11-01/ImportImageFromPublicRegistry.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_create.py deleted file mode 100644 index a9b90e8b8b86..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_create.py +++ /dev/null @@ -1,62 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python import_pipeline_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.import_pipelines.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - import_pipeline_name="myImportPipeline", - import_pipeline_create_parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": {} - }, - }, - "location": "westus", - "properties": { - "options": ["OverwriteTags", "DeleteSourceBlobOnSuccess", "ContinueOnErrors"], - "source": { - "keyVaultUri": "https://myvault.vault.azure.net/secrets/acrimportsas", - "storageAccessMode": "SasToken", - "type": "AzureStorageBlobContainer", - "uri": "https://accountname.blob.core.windows.net/containername", - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ImportPipelineCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_delete.py deleted file mode 100644 index 3303fc05885d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python import_pipeline_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.import_pipelines.begin_delete( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - import_pipeline_name="myImportPipeline", - ).result() - - -# x-ms-original-file: 2026-10-15-preview/ImportPipelineDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_get.py deleted file mode 100644 index 88419dfb0831..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python import_pipeline_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.import_pipelines.get( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - import_pipeline_name="myImportPipeline", - ) - print(response) - - -# x-ms-original-file: 2026-10-15-preview/ImportPipelineGet.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_list.py deleted file mode 100644 index 30e5a148174a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/import_pipeline_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python import_pipeline_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.import_pipelines.list( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-10-15-preview/ImportPipelineList.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/operation_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/operation_list.py index c015c956e213..363ae8744881 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/operation_list.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/operation_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/OperationList.json +# x-ms-original-file: 2026-11-01/OperationList.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_create_export.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_create_export.py deleted file mode 100644 index fcd23389ed16..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_create_export.py +++ /dev/null @@ -1,56 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python pipeline_run_create_export.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.pipeline_runs.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - pipeline_run_name="myPipelineRun", - pipeline_run_create_parameters={ - "properties": { - "request": { - "artifacts": [ - "sourceRepository/hello-world", - "sourceRepository2@sha256:00000000000000000000000000000000000", - ], - "pipelineResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline", - "target": {"name": "myblob.tar.gz", "type": "AzureStorageBlob"}, - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/PipelineRunCreate_Export.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_create_import.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_create_import.py deleted file mode 100644 index df4352a385ce..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_create_import.py +++ /dev/null @@ -1,54 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python pipeline_run_create_import.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.pipeline_runs.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - pipeline_run_name="myPipelineRun", - pipeline_run_create_parameters={ - "properties": { - "forceUpdateTag": "2020-03-04T17:23:21.9261521+00:00", - "request": { - "catalogDigest": "sha256@", - "pipelineResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline", - "source": {"name": "myblob.tar.gz", "type": "AzureStorageBlob"}, - }, - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/PipelineRunCreate_Import.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_delete.py deleted file mode 100644 index b48d64490ded..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python pipeline_run_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.pipeline_runs.begin_delete( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - pipeline_run_name="myPipelineRun", - ).result() - - -# x-ms-original-file: 2026-10-15-preview/PipelineRunDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_get.py deleted file mode 100644 index d45be8574db1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python pipeline_run_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.pipeline_runs.get( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - pipeline_run_name="myPipelineRun", - ) - print(response) - - -# x-ms-original-file: 2026-10-15-preview/PipelineRunGet.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_list.py deleted file mode 100644 index 7bef59bb9e40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/pipeline_run_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python pipeline_run_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.pipeline_runs.list( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-10-15-preview/PipelineRunList.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_create_or_update.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_create_or_update.py index 9b0440e9235e..7854b9ee3555 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_create_or_update.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_create_or_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/PrivateEndpointConnectionCreateOrUpdate.json +# x-ms-original-file: 2026-11-01/PrivateEndpointConnectionCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_delete.py index ab18ba30596e..33060bcaf027 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_delete.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/PrivateEndpointConnectionDelete.json +# x-ms-original-file: 2026-11-01/PrivateEndpointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_get.py index 420da9ad2e48..1113c421d452 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_get.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/PrivateEndpointConnectionGet.json +# x-ms-original-file: 2026-11-01/PrivateEndpointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_list.py index 18792053a418..045b11f33013 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_list.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/private_endpoint_connection_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/PrivateEndpointConnectionList.json +# x-ms-original-file: 2026-11-01/PrivateEndpointConnectionList.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_check_name_available.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_check_name_available.py index 10169b0fb67d..c6a811fa5e61 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_check_name_available.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_check_name_available.py @@ -31,16 +31,11 @@ def main(): ) response = client.registries.check_name_availability( - registry_name_check_request={ - "autoGeneratedDomainNameLabelScope": "ResourceGroupReuse", - "name": "myRegistry", - "resourceGroupName": "myResourceGroup", - "type": "Microsoft.ContainerRegistry/registries", - }, + registry_name_check_request={"name": "myRegistry", "type": "Microsoft.ContainerRegistry/registries"}, ) print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryCheckNameAvailable.json +# x-ms-original-file: 2026-11-01/RegistryCheckNameAvailable.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_check_name_not_available.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_check_name_not_available.py index 7d31615a7601..9ab60e1fb6ec 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_check_name_not_available.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_check_name_not_available.py @@ -31,16 +31,11 @@ def main(): ) response = client.registries.check_name_availability( - registry_name_check_request={ - "autoGeneratedDomainNameLabelScope": "ResourceGroupReuse", - "name": "myRegistry", - "resourceGroupName": "myResourceGroup", - "type": "Microsoft.ContainerRegistry/registries", - }, + registry_name_check_request={"name": "myRegistry", "type": "Microsoft.ContainerRegistry/registries"}, ) print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryCheckNameNotAvailable.json +# x-ms-original-file: 2026-11-01/RegistryCheckNameNotAvailable.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create.py index 5ef6188cdd63..b5386dcf8128 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create.py @@ -35,14 +35,19 @@ def main(): registry_name="myRegistry", registry={ "location": "westus", - "properties": {"adminUserEnabled": True}, - "sku": {"name": "Standard"}, + "properties": { + "adminUserEnabled": True, + "dataEndpointEnabled": True, + "endpointProtocol": "IPv4AndIPv6", + "regionalEndpoints": "Enabled", + }, + "sku": {"name": "Premium"}, "tags": {"key": "value"}, }, ).result() print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryCreate.json +# x-ms-original-file: 2026-11-01/RegistryCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_abac.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_abac.py index a218e65bba60..7ddf3786036c 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_abac.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_abac.py @@ -35,7 +35,7 @@ def main(): registry_name="myRegistry", registry={ "location": "westus", - "properties": {"roleAssignmentMode": "AbacRepositoryPermissions"}, + "properties": {"endpointProtocol": "IPv4", "roleAssignmentMode": "AbacRepositoryPermissions"}, "sku": {"name": "Standard"}, "tags": {"key": "value"}, }, @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryCreateAbac.json +# x-ms-original-file: 2026-11-01/RegistryCreateAbac.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_domain_name_label_scope.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_domain_name_label_scope.py deleted file mode 100644 index 0d817682dace..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_domain_name_label_scope.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-containerregistry -# USAGE - python registry_create_domain_name_label_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerRegistryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.registries.begin_create( - resource_group_name="myResourceGroup", - registry_name="myRegistry", - registry={ - "location": "westus", - "properties": {"autoGeneratedDomainNameLabelScope": "TenantReuse"}, - "sku": {"name": "Standard"}, - "tags": {"key": "value"}, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-10-15-preview/RegistryCreateDomainNameLabelScope.json -if __name__ == "__main__": - main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_zone_redundant.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_zone_redundant.py index 72514b0e5550..e4e86ce6674e 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_zone_redundant.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_create_zone_redundant.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryCreateZoneRedundant.json +# x-ms-original-file: 2026-11-01/RegistryCreateZoneRedundant.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_delete.py index 046e2c4a0ed0..aa603c600576 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_delete.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/RegistryDelete.json +# x-ms-original-file: 2026-11-01/RegistryDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_generate_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_generate_credentials.py index 4675e1952e27..a5e0eb2b3483 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_generate_credentials.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_generate_credentials.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryGenerateCredentials.json +# x-ms-original-file: 2026-11-01/RegistryGenerateCredentials.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_get.py index 2c4e7e623ce5..d3fa132e6755 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_get.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryGet.json +# x-ms-original-file: 2026-11-01/RegistryGet.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_get_private_link_resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_get_private_link_resource.py index 3e7a21ebb175..a17143e1d695 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_get_private_link_resource.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_get_private_link_resource.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryGetPrivateLinkResource.json +# x-ms-original-file: 2026-11-01/RegistryGetPrivateLinkResource.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list.py index 24b25c8d92a4..66362f51cb8e 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/RegistryList.json +# x-ms-original-file: 2026-11-01/RegistryList.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_by_resource_group.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_by_resource_group.py index cb7778d294ec..b6e29a2ffecf 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_by_resource_group.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/RegistryListByResourceGroup.json +# x-ms-original-file: 2026-11-01/RegistryListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_credentials.py index 2d2a43f4a14a..f01cd855d5e6 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_credentials.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_credentials.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryListCredentials.json +# x-ms-original-file: 2026-11-01/RegistryListCredentials.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_private_link_resources.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_private_link_resources.py index 8ce0df77f649..df9d4a3bd23c 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_private_link_resources.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_private_link_resources.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/RegistryListPrivateLinkResources.json +# x-ms-original-file: 2026-11-01/RegistryListPrivateLinkResources.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_usages.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_usages.py index a54b8996f037..620c788f262f 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_usages.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_list_usages.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryListUsages.json +# x-ms-original-file: 2026-11-01/RegistryListUsages.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_regenerate_credential.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_regenerate_credential.py index 9355c192897f..b876747291da 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_regenerate_credential.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_regenerate_credential.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryRegenerateCredential.json +# x-ms-original-file: 2026-11-01/RegistryRegenerateCredential.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_update.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_update.py index 7286faec2a1e..6ad5400ce9d7 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_update.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/registry_update.py @@ -34,14 +34,20 @@ def main(): resource_group_name="myResourceGroup", registry_name="myRegistry", registry_update_parameters={ - "properties": {"adminUserEnabled": True, "roleAssignmentMode": "AbacRepositoryPermissions"}, - "sku": {"name": "Standard"}, + "properties": { + "adminUserEnabled": True, + "dataEndpointEnabled": True, + "endpointProtocol": "IPv4AndIPv6", + "regionalEndpoints": "Enabled", + "roleAssignmentMode": "AbacRepositoryPermissions", + }, + "sku": {"name": "Premium"}, "tags": {"key": "value"}, }, ).result() print(response) -# x-ms-original-file: 2026-10-15-preview/RegistryUpdate.json +# x-ms-original-file: 2026-11-01/RegistryUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_create.py index 724c51e17f7e..d7314f8868f7 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_create.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_create.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/ReplicationCreate.json +# x-ms-original-file: 2026-11-01/ReplicationCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_create_zone_redundant.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_create_zone_redundant.py index ec6d1c945a42..87f6dba8ee96 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_create_zone_redundant.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_create_zone_redundant.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/ReplicationCreateZoneRedundant.json +# x-ms-original-file: 2026-11-01/ReplicationCreateZoneRedundant.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_delete.py index b7e9b4533d15..91869d42500e 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_delete.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/ReplicationDelete.json +# x-ms-original-file: 2026-11-01/ReplicationDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_get.py index 20e27d88a36e..8f04b3b64c27 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_get.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/ReplicationGet.json +# x-ms-original-file: 2026-11-01/ReplicationGet.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_list.py index c5ecc6f5ddd7..98ca61068044 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_list.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/ReplicationList.json +# x-ms-original-file: 2026-11-01/ReplicationList.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_update.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_update.py index 2c12cf6b83f9..1ba659f4c6ae 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_update.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/replication_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/ReplicationUpdate.json +# x-ms-original-file: 2026-11-01/ReplicationUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_create.py index 699a1d2ce052..a74a63e95c07 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_create.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_create.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/ScopeMapCreate.json +# x-ms-original-file: 2026-11-01/ScopeMapCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_delete.py index ca394e028697..6a6d34f2f484 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_delete.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/ScopeMapDelete.json +# x-ms-original-file: 2026-11-01/ScopeMapDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_get.py index ae21254918da..85d38205a1d0 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_get.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/ScopeMapGet.json +# x-ms-original-file: 2026-11-01/ScopeMapGet.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_list.py index ef92029774d0..5c03d45e777f 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_list.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/ScopeMapList.json +# x-ms-original-file: 2026-11-01/ScopeMapList.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_update.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_update.py index 0af0f4d864eb..b7de906622ad 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_update.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/scope_map_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/ScopeMapUpdate.json +# x-ms-original-file: 2026-11-01/ScopeMapUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_create.py index ed79b636e9b3..04d788c6c7c1 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_create.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_create.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/TokenCreate.json +# x-ms-original-file: 2026-11-01/TokenCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_delete.py index d9f08e85d7d0..67bbc05d5d86 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_delete.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/TokenDelete.json +# x-ms-original-file: 2026-11-01/TokenDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_get.py index cdfba36a587c..0ae834fc2a9a 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_get.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/TokenGet.json +# x-ms-original-file: 2026-11-01/TokenGet.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_list.py index 9a4db73abacd..d1051461c404 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_list.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/TokenList.json +# x-ms-original-file: 2026-11-01/TokenList.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_update.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_update.py index f37f3eed2f5e..4edbd5a6b832 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_update.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/token_update.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/TokenUpdate.json +# x-ms-original-file: 2026-11-01/TokenUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_create.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_create.py index b4684e5cf1b8..17423e6d994a 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_create.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_create.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/WebhookCreate.json +# x-ms-original-file: 2026-11-01/WebhookCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_delete.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_delete.py index 25977b259cb7..0b0ec71c4186 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_delete.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-10-15-preview/WebhookDelete.json +# x-ms-original-file: 2026-11-01/WebhookDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_get.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_get.py index 75f256867eb9..c0f75c11ab6c 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_get.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/WebhookGet.json +# x-ms-original-file: 2026-11-01/WebhookGet.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_get_callback_config.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_get_callback_config.py index 60027137492b..397d39cbbe62 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_get_callback_config.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_get_callback_config.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/WebhookGetCallbackConfig.json +# x-ms-original-file: 2026-11-01/WebhookGetCallbackConfig.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_list.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_list.py index b9f2aee28027..e52dd35e0d4e 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_list.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/WebhookList.json +# x-ms-original-file: 2026-11-01/WebhookList.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_list_events.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_list_events.py index 7dd797800c53..c0226f776c4d 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_list_events.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_list_events.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-10-15-preview/WebhookListEvents.json +# x-ms-original-file: 2026-11-01/WebhookListEvents.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_ping.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_ping.py index 5f46fca2ef65..83a63156a6a8 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_ping.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_ping.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/WebhookPing.json +# x-ms-original-file: 2026-11-01/WebhookPing.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_update.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_update.py index 9f6a42082672..b4d85f94178e 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_update.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_samples/webhook_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2026-10-15-preview/WebhookUpdate.json +# x-ms-original-file: 2026-11-01/WebhookUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archive_versions_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archive_versions_operations.py deleted file mode 100644 index 63df19929216..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archive_versions_operations.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerRegistryManagementArchiveVersionsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerRegistryManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_archive_versions_get(self, resource_group): - response = self.client.archive_versions.get( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - archive_version_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_archive_versions_begin_create(self, resource_group): - response = self.client.archive_versions.begin_create( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - archive_version_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_archive_versions_begin_delete(self, resource_group): - response = self.client.archive_versions.begin_delete( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - archive_version_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_archive_versions_list(self, resource_group): - response = self.client.archive_versions.list( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archive_versions_operations_async.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archive_versions_operations_async.py deleted file mode 100644 index 4239c95b1aec..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archive_versions_operations_async.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerregistry.aio import ContainerRegistryManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerRegistryManagementArchiveVersionsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerRegistryManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_archive_versions_get(self, resource_group): - response = await self.client.archive_versions.get( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - archive_version_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_archive_versions_begin_create(self, resource_group): - response = await ( - await self.client.archive_versions.begin_create( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - archive_version_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_archive_versions_begin_delete(self, resource_group): - response = await ( - await self.client.archive_versions.begin_delete( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - archive_version_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_archive_versions_list(self, resource_group): - response = self.client.archive_versions.list( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archives_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archives_operations.py deleted file mode 100644 index ebf2045ea9f4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archives_operations.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerRegistryManagementArchivesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerRegistryManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_archives_get(self, resource_group): - response = self.client.archives.get( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_archives_begin_create(self, resource_group): - response = self.client.archives.begin_create( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - archive_create_parameters={ - "id": "str", - "name": "str", - "properties": { - "packageSource": {"type": "str", "url": "str"}, - "provisioningState": "str", - "publishedVersion": "str", - "repositoryEndpoint": "str", - "repositoryEndpointPrefix": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_archives_update(self, resource_group): - response = self.client.archives.update( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - archive_update_parameters={"properties": {"publishedVersion": "str"}}, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_archives_begin_delete(self, resource_group): - response = self.client.archives.begin_delete( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_archives_list(self, resource_group): - response = self.client.archives.list( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archives_operations_async.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archives_operations_async.py deleted file mode 100644 index 7f4c347e2983..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_archives_operations_async.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerregistry.aio import ContainerRegistryManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerRegistryManagementArchivesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerRegistryManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_archives_get(self, resource_group): - response = await self.client.archives.get( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_archives_begin_create(self, resource_group): - response = await ( - await self.client.archives.begin_create( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - archive_create_parameters={ - "id": "str", - "name": "str", - "properties": { - "packageSource": {"type": "str", "url": "str"}, - "provisioningState": "str", - "publishedVersion": "str", - "repositoryEndpoint": "str", - "repositoryEndpointPrefix": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_archives_update(self, resource_group): - response = await self.client.archives.update( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - archive_update_parameters={"properties": {"publishedVersion": "str"}}, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_archives_begin_delete(self, resource_group): - response = await ( - await self.client.archives.begin_delete( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - archive_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_archives_list(self, resource_group): - response = self.client.archives.list( - resource_group_name=resource_group.name, - registry_name="str", - package_type="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_cache_rules_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_cache_rules_operations.py index 2aa4d9da34d5..c078987e14a8 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_cache_rules_operations.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_cache_rules_operations.py @@ -39,15 +39,8 @@ def test_cache_rules_begin_create(self, resource_group): cache_rule_name="str", cache_rule_create_parameters={ "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "name": "str", "properties": { - "additionalAuthenticationProperties": "additional_authentication_properties", "creationDate": "2020-02-20 00:00:00", "credentialSetResourceId": "str", "provisioningState": "str", @@ -76,18 +69,7 @@ def test_cache_rules_begin_update(self, resource_group): resource_group_name=resource_group.name, registry_name="str", cache_rule_name="str", - cache_rule_update_parameters={ - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "properties": { - "additionalAuthenticationProperties": "additional_authentication_update_properties", - "credentialSetResourceId": "str", - }, - }, + cache_rule_update_parameters={"properties": {"credentialSetResourceId": "str"}}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_cache_rules_operations_async.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_cache_rules_operations_async.py index d4ca2da483c2..93566bd80377 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_cache_rules_operations_async.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_cache_rules_operations_async.py @@ -41,15 +41,8 @@ async def test_cache_rules_begin_create(self, resource_group): cache_rule_name="str", cache_rule_create_parameters={ "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "name": "str", "properties": { - "additionalAuthenticationProperties": "additional_authentication_properties", "creationDate": "2020-02-20 00:00:00", "credentialSetResourceId": "str", "provisioningState": "str", @@ -80,18 +73,7 @@ async def test_cache_rules_begin_update(self, resource_group): resource_group_name=resource_group.name, registry_name="str", cache_rule_name="str", - cache_rule_update_parameters={ - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "properties": { - "additionalAuthenticationProperties": "additional_authentication_update_properties", - "credentialSetResourceId": "str", - }, - }, + cache_rule_update_parameters={"properties": {"credentialSetResourceId": "str"}}, ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_connected_registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_connected_registries_operations.py index 6eddf8f4921b..28013d831bdb 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_connected_registries_operations.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_connected_registries_operations.py @@ -39,19 +39,12 @@ def test_connected_registries_begin_create(self, resource_group): connected_registry_name="str", connected_registry_create_parameters={ "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "name": "str", "properties": { "mode": "str", "parent": { "syncProperties": { "messageTtl": "1 day, 0:00:00", - "authType": "str", "gatewayEndpoint": "str", "lastSyncTime": "2020-02-20 00:00:00", "schedule": "str", @@ -72,21 +65,12 @@ def test_connected_registries_begin_create(self, resource_group): }, "notificationsList": ["str"], "provisioningState": "str", - "registrySyncResult": { - "syncState": "str", - "syncTrigger": "str", - "lastSuccessfulSyncEndTime": "2020-02-20 00:00:00", - "lastSyncEndTime": "2020-02-20 00:00:00", - "lastSyncStartTime": "2020-02-20 00:00:00", - }, "statusDetails": [ { - "availableGib": 0.0, "code": "str", "correlationId": "str", "description": "str", "timestamp": "2020-02-20 00:00:00", - "totalGib": 0.0, "type": "str", } ], @@ -115,24 +99,17 @@ def test_connected_registries_begin_update(self, resource_group): registry_name="str", connected_registry_name="str", connected_registry_update_parameters={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "properties": { "clientTokenIds": ["str"], "garbageCollection": {"enabled": bool, "schedule": "str"}, "logging": {"auditLogStatus": "str", "logLevel": "str"}, "notificationsList": ["str"], "syncProperties": { - "authType": "str", "messageTtl": "1 day, 0:00:00", "schedule": "str", "syncWindow": "1 day, 0:00:00", }, - }, + } }, ).result() # call '.result()' to poll until service return final result @@ -173,15 +150,3 @@ def test_connected_registries_begin_deactivate(self, resource_group): # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_connected_registries_resync(self, resource_group): - response = self.client.connected_registries.resync( - resource_group_name=resource_group.name, - registry_name="str", - connected_registry_name="str", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_connected_registries_operations_async.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_connected_registries_operations_async.py index 7100dfaec46b..668ae8439be0 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_connected_registries_operations_async.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_connected_registries_operations_async.py @@ -41,19 +41,12 @@ async def test_connected_registries_begin_create(self, resource_group): connected_registry_name="str", connected_registry_create_parameters={ "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "name": "str", "properties": { "mode": "str", "parent": { "syncProperties": { "messageTtl": "1 day, 0:00:00", - "authType": "str", "gatewayEndpoint": "str", "lastSyncTime": "2020-02-20 00:00:00", "schedule": "str", @@ -74,21 +67,12 @@ async def test_connected_registries_begin_create(self, resource_group): }, "notificationsList": ["str"], "provisioningState": "str", - "registrySyncResult": { - "syncState": "str", - "syncTrigger": "str", - "lastSuccessfulSyncEndTime": "2020-02-20 00:00:00", - "lastSyncEndTime": "2020-02-20 00:00:00", - "lastSyncStartTime": "2020-02-20 00:00:00", - }, "statusDetails": [ { - "availableGib": 0.0, "code": "str", "correlationId": "str", "description": "str", "timestamp": "2020-02-20 00:00:00", - "totalGib": 0.0, "type": "str", } ], @@ -119,24 +103,17 @@ async def test_connected_registries_begin_update(self, resource_group): registry_name="str", connected_registry_name="str", connected_registry_update_parameters={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "properties": { "clientTokenIds": ["str"], "garbageCollection": {"enabled": bool, "schedule": "str"}, "logging": {"auditLogStatus": "str", "logLevel": "str"}, "notificationsList": ["str"], "syncProperties": { - "authType": "str", "messageTtl": "1 day, 0:00:00", "schedule": "str", "syncWindow": "1 day, 0:00:00", }, - }, + } }, ) ).result() # call '.result()' to poll until service return final result @@ -182,15 +159,3 @@ async def test_connected_registries_begin_deactivate(self, resource_group): # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_connected_registries_resync(self, resource_group): - response = await self.client.connected_registries.resync( - resource_group_name=resource_group.name, - registry_name="str", - connected_registry_name="str", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_export_pipelines_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_export_pipelines_operations.py deleted file mode 100644 index 8eb2e755de55..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_export_pipelines_operations.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerRegistryManagementExportPipelinesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerRegistryManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_export_pipelines_get(self, resource_group): - response = self.client.export_pipelines.get( - resource_group_name=resource_group.name, - registry_name="str", - export_pipeline_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_export_pipelines_begin_create(self, resource_group): - response = self.client.export_pipelines.begin_create( - resource_group_name=resource_group.name, - registry_name="str", - export_pipeline_name="str", - export_pipeline_create_parameters={ - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "properties": { - "target": {"keyVaultUri": "str", "storageAccessMode": "str", "type": "str", "uri": "str"}, - "options": ["str"], - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_export_pipelines_begin_delete(self, resource_group): - response = self.client.export_pipelines.begin_delete( - resource_group_name=resource_group.name, - registry_name="str", - export_pipeline_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_export_pipelines_list(self, resource_group): - response = self.client.export_pipelines.list( - resource_group_name=resource_group.name, - registry_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_export_pipelines_operations_async.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_export_pipelines_operations_async.py deleted file mode 100644 index 4e7244db7f17..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_export_pipelines_operations_async.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerregistry.aio import ContainerRegistryManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerRegistryManagementExportPipelinesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerRegistryManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_export_pipelines_get(self, resource_group): - response = await self.client.export_pipelines.get( - resource_group_name=resource_group.name, - registry_name="str", - export_pipeline_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_export_pipelines_begin_create(self, resource_group): - response = await ( - await self.client.export_pipelines.begin_create( - resource_group_name=resource_group.name, - registry_name="str", - export_pipeline_name="str", - export_pipeline_create_parameters={ - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "properties": { - "target": {"keyVaultUri": "str", "storageAccessMode": "str", "type": "str", "uri": "str"}, - "options": ["str"], - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_export_pipelines_begin_delete(self, resource_group): - response = await ( - await self.client.export_pipelines.begin_delete( - resource_group_name=resource_group.name, - registry_name="str", - export_pipeline_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_export_pipelines_list(self, resource_group): - response = self.client.export_pipelines.list( - resource_group_name=resource_group.name, - registry_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_import_pipelines_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_import_pipelines_operations.py deleted file mode 100644 index 894624dd301e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_import_pipelines_operations.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerRegistryManagementImportPipelinesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerRegistryManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_import_pipelines_get(self, resource_group): - response = self.client.import_pipelines.get( - resource_group_name=resource_group.name, - registry_name="str", - import_pipeline_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_import_pipelines_begin_create(self, resource_group): - response = self.client.import_pipelines.begin_create( - resource_group_name=resource_group.name, - registry_name="str", - import_pipeline_name="str", - import_pipeline_create_parameters={ - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "properties": { - "source": {"keyVaultUri": "str", "storageAccessMode": "str", "type": "str", "uri": "str"}, - "options": ["str"], - "provisioningState": "str", - "trigger": {"sourceTrigger": {"status": "str"}}, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_import_pipelines_begin_delete(self, resource_group): - response = self.client.import_pipelines.begin_delete( - resource_group_name=resource_group.name, - registry_name="str", - import_pipeline_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_import_pipelines_list(self, resource_group): - response = self.client.import_pipelines.list( - resource_group_name=resource_group.name, - registry_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_import_pipelines_operations_async.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_import_pipelines_operations_async.py deleted file mode 100644 index 544ba1c70a61..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_import_pipelines_operations_async.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerregistry.aio import ContainerRegistryManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerRegistryManagementImportPipelinesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerRegistryManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_import_pipelines_get(self, resource_group): - response = await self.client.import_pipelines.get( - resource_group_name=resource_group.name, - registry_name="str", - import_pipeline_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_import_pipelines_begin_create(self, resource_group): - response = await ( - await self.client.import_pipelines.begin_create( - resource_group_name=resource_group.name, - registry_name="str", - import_pipeline_name="str", - import_pipeline_create_parameters={ - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "properties": { - "source": {"keyVaultUri": "str", "storageAccessMode": "str", "type": "str", "uri": "str"}, - "options": ["str"], - "provisioningState": "str", - "trigger": {"sourceTrigger": {"status": "str"}}, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_import_pipelines_begin_delete(self, resource_group): - response = await ( - await self.client.import_pipelines.begin_delete( - resource_group_name=resource_group.name, - registry_name="str", - import_pipeline_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_import_pipelines_list(self, resource_group): - response = self.client.import_pipelines.list( - resource_group_name=resource_group.name, - registry_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_pipeline_runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_pipeline_runs_operations.py deleted file mode 100644 index 5d2dd63d0d11..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_pipeline_runs_operations.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerregistry import ContainerRegistryManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerRegistryManagementPipelineRunsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerRegistryManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_pipeline_runs_get(self, resource_group): - response = self.client.pipeline_runs.get( - resource_group_name=resource_group.name, - registry_name="str", - pipeline_run_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_pipeline_runs_begin_create(self, resource_group): - response = self.client.pipeline_runs.begin_create( - resource_group_name=resource_group.name, - registry_name="str", - pipeline_run_name="str", - pipeline_run_create_parameters={ - "id": "str", - "name": "str", - "properties": { - "forceUpdateTag": "str", - "provisioningState": "str", - "request": { - "artifacts": ["str"], - "catalogDigest": "str", - "pipelineResourceId": "str", - "source": {"name": "str", "type": "str"}, - "target": {"name": "str", "type": "str"}, - }, - "response": { - "catalogDigest": "str", - "finishTime": "2020-02-20 00:00:00", - "importedArtifacts": ["str"], - "pipelineRunErrorMessage": "str", - "progress": {"percentage": "str"}, - "source": {"keyVaultUri": "str", "storageAccessMode": "str", "type": "str", "uri": "str"}, - "startTime": "2020-02-20 00:00:00", - "status": "str", - "target": {"keyVaultUri": "str", "storageAccessMode": "str", "type": "str", "uri": "str"}, - "trigger": {"sourceTrigger": {"timestamp": "2020-02-20 00:00:00"}}, - }, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_pipeline_runs_begin_delete(self, resource_group): - response = self.client.pipeline_runs.begin_delete( - resource_group_name=resource_group.name, - registry_name="str", - pipeline_run_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_pipeline_runs_list(self, resource_group): - response = self.client.pipeline_runs.list( - resource_group_name=resource_group.name, - registry_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_pipeline_runs_operations_async.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_pipeline_runs_operations_async.py deleted file mode 100644 index e8e9f6507d81..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_pipeline_runs_operations_async.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerregistry.aio import ContainerRegistryManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerRegistryManagementPipelineRunsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerRegistryManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_pipeline_runs_get(self, resource_group): - response = await self.client.pipeline_runs.get( - resource_group_name=resource_group.name, - registry_name="str", - pipeline_run_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_pipeline_runs_begin_create(self, resource_group): - response = await ( - await self.client.pipeline_runs.begin_create( - resource_group_name=resource_group.name, - registry_name="str", - pipeline_run_name="str", - pipeline_run_create_parameters={ - "id": "str", - "name": "str", - "properties": { - "forceUpdateTag": "str", - "provisioningState": "str", - "request": { - "artifacts": ["str"], - "catalogDigest": "str", - "pipelineResourceId": "str", - "source": {"name": "str", "type": "str"}, - "target": {"name": "str", "type": "str"}, - }, - "response": { - "catalogDigest": "str", - "finishTime": "2020-02-20 00:00:00", - "importedArtifacts": ["str"], - "pipelineRunErrorMessage": "str", - "progress": {"percentage": "str"}, - "source": {"keyVaultUri": "str", "storageAccessMode": "str", "type": "str", "uri": "str"}, - "startTime": "2020-02-20 00:00:00", - "status": "str", - "target": {"keyVaultUri": "str", "storageAccessMode": "str", "type": "str", "uri": "str"}, - "trigger": {"sourceTrigger": {"timestamp": "2020-02-20 00:00:00"}}, - }, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_pipeline_runs_begin_delete(self, resource_group): - response = await ( - await self.client.pipeline_runs.begin_delete( - resource_group_name=resource_group.name, - registry_name="str", - pipeline_run_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_pipeline_runs_list(self, resource_group): - response = self.client.pipeline_runs.list( - resource_group_name=resource_group.name, - registry_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_registries_operations.py index bc28d48ab342..487ddfacf128 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_registries_operations.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_registries_operations.py @@ -49,7 +49,6 @@ def test_registries_begin_create(self, resource_group): "properties": { "adminUserEnabled": bool, "anonymousPullEnabled": bool, - "autoGeneratedDomainNameLabelScope": "str", "creationDate": "2020-02-20 00:00:00", "dataEndpointEnabled": bool, "dataEndpointHostNames": ["str"], @@ -65,7 +64,6 @@ def test_registries_begin_create(self, resource_group): }, "endpointProtocol": "str", "loginServer": "str", - "metadataSearch": "str", "networkRuleBypassAllowedForTasks": bool, "networkRuleBypassOptions": "str", "networkRuleSet": { @@ -78,11 +76,6 @@ def test_registries_begin_create(self, resource_group): "exportPolicy": {"status": "str"}, "quarantinePolicy": {"status": "str"}, "retentionPolicy": {"days": 0, "lastUpdatedTime": "2020-02-20 00:00:00", "status": "str"}, - "softDeletePolicy": { - "lastUpdatedTime": "2020-02-20 00:00:00", - "retentionDays": 0, - "status": "str", - }, "trustPolicy": {"status": "str", "type": "str"}, }, "privateEndpointConnections": [ @@ -115,7 +108,6 @@ def test_registries_begin_create(self, resource_group): "regionalEndpoints": "str", "roleAssignmentMode": "str", "status": {"displayStatus": "str", "message": "str", "timestamp": "2020-02-20 00:00:00"}, - "writableCacheRepos": "str", "zoneRedundancy": "str", }, "systemData": { @@ -162,7 +154,6 @@ def test_registries_begin_update(self, resource_group): "status": "str", }, "endpointProtocol": "str", - "metadataSearch": "str", "networkRuleBypassAllowedForTasks": bool, "networkRuleBypassOptions": "str", "networkRuleSet": { @@ -175,17 +166,11 @@ def test_registries_begin_update(self, resource_group): "exportPolicy": {"status": "str"}, "quarantinePolicy": {"status": "str"}, "retentionPolicy": {"days": 0, "lastUpdatedTime": "2020-02-20 00:00:00", "status": "str"}, - "softDeletePolicy": { - "lastUpdatedTime": "2020-02-20 00:00:00", - "retentionDays": 0, - "status": "str", - }, "trustPolicy": {"status": "str", "type": "str"}, }, "publicNetworkAccess": "str", "regionalEndpoints": "str", "roleAssignmentMode": "str", - "writableCacheRepos": "str", }, "sku": {"name": "str", "tier": "str"}, "tags": {"str": "str"}, @@ -296,12 +281,7 @@ def test_registries_begin_generate_credentials(self, resource_group): @recorded_by_proxy def test_registries_check_name_availability(self, resource_group): response = self.client.registries.check_name_availability( - registry_name_check_request={ - "name": "str", - "type": "str", - "autoGeneratedDomainNameLabelScope": "str", - "resourceGroupName": "str", - }, + registry_name_check_request={"name": "str", "type": "str"}, ) # please add some check logic here by yourself diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_registries_operations_async.py b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_registries_operations_async.py index d194401978c1..2600c2b744ff 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_registries_operations_async.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/generated_tests/test_container_registry_management_registries_operations_async.py @@ -51,7 +51,6 @@ async def test_registries_begin_create(self, resource_group): "properties": { "adminUserEnabled": bool, "anonymousPullEnabled": bool, - "autoGeneratedDomainNameLabelScope": "str", "creationDate": "2020-02-20 00:00:00", "dataEndpointEnabled": bool, "dataEndpointHostNames": ["str"], @@ -67,7 +66,6 @@ async def test_registries_begin_create(self, resource_group): }, "endpointProtocol": "str", "loginServer": "str", - "metadataSearch": "str", "networkRuleBypassAllowedForTasks": bool, "networkRuleBypassOptions": "str", "networkRuleSet": { @@ -80,11 +78,6 @@ async def test_registries_begin_create(self, resource_group): "exportPolicy": {"status": "str"}, "quarantinePolicy": {"status": "str"}, "retentionPolicy": {"days": 0, "lastUpdatedTime": "2020-02-20 00:00:00", "status": "str"}, - "softDeletePolicy": { - "lastUpdatedTime": "2020-02-20 00:00:00", - "retentionDays": 0, - "status": "str", - }, "trustPolicy": {"status": "str", "type": "str"}, }, "privateEndpointConnections": [ @@ -117,7 +110,6 @@ async def test_registries_begin_create(self, resource_group): "regionalEndpoints": "str", "roleAssignmentMode": "str", "status": {"displayStatus": "str", "message": "str", "timestamp": "2020-02-20 00:00:00"}, - "writableCacheRepos": "str", "zoneRedundancy": "str", }, "systemData": { @@ -166,7 +158,6 @@ async def test_registries_begin_update(self, resource_group): "status": "str", }, "endpointProtocol": "str", - "metadataSearch": "str", "networkRuleBypassAllowedForTasks": bool, "networkRuleBypassOptions": "str", "networkRuleSet": { @@ -179,17 +170,11 @@ async def test_registries_begin_update(self, resource_group): "exportPolicy": {"status": "str"}, "quarantinePolicy": {"status": "str"}, "retentionPolicy": {"days": 0, "lastUpdatedTime": "2020-02-20 00:00:00", "status": "str"}, - "softDeletePolicy": { - "lastUpdatedTime": "2020-02-20 00:00:00", - "retentionDays": 0, - "status": "str", - }, "trustPolicy": {"status": "str", "type": "str"}, }, "publicNetworkAccess": "str", "regionalEndpoints": "str", "roleAssignmentMode": "str", - "writableCacheRepos": "str", }, "sku": {"name": "str", "tier": "str"}, "tags": {"str": "str"}, @@ -307,12 +292,7 @@ async def test_registries_begin_generate_credentials(self, resource_group): @recorded_by_proxy_async async def test_registries_check_name_availability(self, resource_group): response = await self.client.registries.check_name_availability( - registry_name_check_request={ - "name": "str", - "type": "str", - "autoGeneratedDomainNameLabelScope": "str", - "resourceGroupName": "str", - }, + registry_name_check_request={"name": "str", "type": "str"}, ) # please add some check logic here by yourself diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/pyproject.toml b/sdk/containerregistry/azure-mgmt-containerregistry/pyproject.toml index d4d14255b1d6..addefde8c91d 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/pyproject.toml +++ b/sdk/containerregistry/azure-mgmt-containerregistry/pyproject.toml @@ -13,7 +13,7 @@ authors = [ description = "Microsoft Azure Containerregistry Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", @@ -80,7 +80,7 @@ verifytypes = false package_name = "azure-mgmt-containerregistry" package_pprint_name = "Container Registry" package_doc_id = "container-registry" -is_stable = false +is_stable = true is_arm = true sample_link = "" title = "ContainerRegistryManagementClient" diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/tsp-location.yaml b/sdk/containerregistry/azure-mgmt-containerregistry/tsp-location.yaml index b804df30b1b5..ab2a4bf542f9 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/tsp-location.yaml +++ b/sdk/containerregistry/azure-mgmt-containerregistry/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry -commit: 939d1a81ec5159e61394cd8ca2589c2c0ce49ccd +commit: 6482a1641d3d8568a0314ece4244119aee68ab27 repo: Azure/azure-rest-api-specs additionalDirectories: