From e475f4f6a6894ef6568fdb6e05891fa8c85c103b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 12 May 2025 23:05:39 +0000 Subject: [PATCH] CodeGen from PR 34510 in Azure/azure-rest-api-specs Merge 54d041451e630c4b84ad726778852c5b43b7595f into 1e37d13d12612ab6abbbc4f9539e1f6ec507663b --- ...esourceManager.ContainerRegistry.net8.0.cs | 621 +++++++++++++++- ...anager.ContainerRegistry.netstandard2.0.cs | 621 +++++++++++++++- .../Sample_ConnectedRegistryCollection.cs | 10 +- .../Sample_ConnectedRegistryResource.cs | 8 +- ...le_ContainerRegistryAgentPoolCollection.cs | 10 +- ...mple_ContainerRegistryAgentPoolResource.cs | 8 +- ...mple_ContainerRegistryArchiveCollection.cs | 211 ++++++ ...Sample_ContainerRegistryArchiveResource.cs | 115 +++ ...ntainerRegistryArchiveVersionCollection.cs | 205 ++++++ ...ContainerRegistryArchiveVersionResource.cs | 114 +++ ...le_ContainerRegistryCacheRuleCollection.cs | 10 +- ...mple_ContainerRegistryCacheRuleResource.cs | 6 +- .../Sample_ContainerRegistryCollection.cs | 96 ++- ...ontainerRegistryCredentialSetCollection.cs | 10 +- ..._ContainerRegistryCredentialSetResource.cs | 6 +- ...ntainerRegistryExportPipelineCollection.cs | 210 ++++++ ...ContainerRegistryExportPipelineResource.cs | 123 ++++ ...ntainerRegistryImportPipelineCollection.cs | 216 ++++++ ...ContainerRegistryImportPipelineResource.cs | 129 ++++ ..._ContainerRegistryPipelineRunCollection.cs | 258 +++++++ ...le_ContainerRegistryPipelineRunResource.cs | 168 +++++ ...stryPrivateEndpointConnectionCollection.cs | 10 +- ...gistryPrivateEndpointConnectionResource.cs | 6 +- ...le_ContainerRegistryPrivateLinkResource.cs | 2 +- ...erRegistryPrivateLinkResourceCollection.cs | 8 +- ..._ContainerRegistryReplicationCollection.cs | 12 +- ...le_ContainerRegistryReplicationResource.cs | 6 +- .../Sample_ContainerRegistryResource.cs | 68 +- .../Sample_ContainerRegistryRunCollection.cs | 8 +- .../Sample_ContainerRegistryRunResource.cs | 13 +- .../Sample_ContainerRegistryTaskCollection.cs | 100 ++- .../Sample_ContainerRegistryTaskResource.cs | 99 ++- ...mple_ContainerRegistryTaskRunCollection.cs | 10 +- ...Sample_ContainerRegistryTaskRunResource.cs | 8 +- ...Sample_ContainerRegistryTokenCollection.cs | 10 +- .../Sample_ContainerRegistryTokenResource.cs | 6 +- ...mple_ContainerRegistryWebhookCollection.cs | 10 +- ...Sample_ContainerRegistryWebhookResource.cs | 12 +- .../Samples/Sample_ScopeMapCollection.cs | 10 +- .../Samples/Sample_ScopeMapResource.cs | 6 +- .../Sample_SubscriptionResourceExtensions.cs | 18 +- .../ArmContainerRegistryModelFactory.cs | 247 ++++++- .../Generated/ConnectedRegistryCollection.cs | 20 +- .../ConnectedRegistryData.Serialization.cs | 4 +- .../src/Generated/ConnectedRegistryData.cs | 12 +- .../Generated/ConnectedRegistryResource.cs | 16 +- .../ContainerRegistryAgentPoolCollection.cs | 24 +- .../ContainerRegistryAgentPoolResource.cs | 32 +- .../ContainerRegistryArchiveCollection.cs | 498 +++++++++++++ ...tainerRegistryArchiveData.Serialization.cs | 395 +++++++++++ .../Generated/ContainerRegistryArchiveData.cs | 96 +++ ...erRegistryArchiveResource.Serialization.cs | 26 + .../ContainerRegistryArchiveResource.cs | 410 +++++++++++ ...ntainerRegistryArchiveVersionCollection.cs | 489 +++++++++++++ ...egistryArchiveVersionData.Serialization.cs | 294 ++++++++ .../ContainerRegistryArchiveVersionData.cs | 81 +++ ...tryArchiveVersionResource.Serialization.cs | 26 + ...ContainerRegistryArchiveVersionResource.cs | 341 +++++++++ .../ContainerRegistryCacheRuleCollection.cs | 20 +- .../ContainerRegistryCacheRuleResource.cs | 12 +- .../Generated/ContainerRegistryCollection.cs | 20 +- ...ontainerRegistryCredentialSetCollection.cs | 20 +- .../ContainerRegistryCredentialSetResource.cs | 12 +- .../ContainerRegistryData.Serialization.cs | 93 +++ .../src/Generated/ContainerRegistryData.cs | 17 +- ...ntainerRegistryExportPipelineCollection.cs | 493 +++++++++++++ ...egistryExportPipelineData.Serialization.cs | 402 +++++++++++ .../ContainerRegistryExportPipelineData.cs | 97 +++ ...tryExportPipelineResource.Serialization.cs | 26 + ...ContainerRegistryExportPipelineResource.cs | 347 +++++++++ ...ntainerRegistryImportPipelineCollection.cs | 493 +++++++++++++ ...egistryImportPipelineData.Serialization.cs | 440 ++++++++++++ .../ContainerRegistryImportPipelineData.cs | 121 ++++ ...tryImportPipelineResource.Serialization.cs | 26 + ...ContainerRegistryImportPipelineResource.cs | 347 +++++++++ .../ContainerRegistryPipelineRunCollection.cs | 493 +++++++++++++ ...erRegistryPipelineRunData.Serialization.cs | 356 ++++++++++ .../ContainerRegistryPipelineRunData.cs | 91 +++ ...gistryPipelineRunResource.Serialization.cs | 26 + .../ContainerRegistryPipelineRunResource.cs | 347 +++++++++ ...stryPrivateEndpointConnectionCollection.cs | 20 +- ...gistryPrivateEndpointConnectionResource.cs | 12 +- .../ContainerRegistryPrivateLinkResource.cs | 4 +- ...erRegistryPrivateLinkResourceCollection.cs | 16 +- .../ContainerRegistryReplicationCollection.cs | 20 +- .../ContainerRegistryReplicationResource.cs | 24 +- .../Generated/ContainerRegistryResource.cs | 401 +++++++++-- .../ContainerRegistryRunCollection.cs | 16 +- .../Generated/ContainerRegistryRunResource.cs | 48 +- .../ContainerRegistryTaskCollection.cs | 28 +- .../ContainerRegistryTaskResource.cs | 76 +- .../ContainerRegistryTaskRunCollection.cs | 24 +- .../ContainerRegistryTaskRunResource.cs | 28 +- .../ContainerRegistryTokenCollection.cs | 20 +- .../ContainerRegistryTokenResource.cs | 12 +- .../ContainerRegistryWebhookCollection.cs | 20 +- .../ContainerRegistryWebhookResource.cs | 36 +- .../Extensions/ContainerRegistryExtensions.cs | 107 ++- .../MockableContainerRegistryArmClient.cs | 60 ++ ...eContainerRegistryResourceGroupResource.cs | 4 +- ...leContainerRegistrySubscriptionResource.cs | 8 +- ...ContainerRegistryArchiveOperationSource.cs | 36 + ...erRegistryArchiveVersionOperationSource.cs | 36 + ...erRegistryExportPipelineOperationSource.cs | 36 + ...erRegistryImportPipelineOperationSource.cs | 36 + ...ainerRegistryPipelineRunOperationSource.cs | 36 + .../ContainerRegistryRunOperationSource.cs | 36 - .../ContainerRegistryTaskOperationSource.cs | 36 - .../Models/ArchiveListResult.Serialization.cs | 219 ++++++ .../src/Generated/Models/ArchiveListResult.cs | 70 ++ ...vePackageSourceProperties.Serialization.cs | 196 ++++++ .../Models/ArchivePackageSourceProperties.cs | 71 ++ .../Models/ArchivePackageSourceType.cs | 48 ++ .../ArchiveVersionListResult.Serialization.cs | 219 ++++++ .../Models/ArchiveVersionListResult.cs | 70 ++ .../AutoGeneratedDomainNameLabelScope.cs | 60 ++ .../Models/ConnectedRegistryActivation.cs | 2 +- .../Models/ConnectedRegistryPatch.cs | 4 +- ...egistryPipelineRunContent.Serialization.cs | 328 +++++++++ .../ConnectedRegistryPipelineRunContent.cs | 98 +++ .../ConnectedRegistryPropertiesActivation.cs | 28 - ...ainerRegistryArchivePatch.Serialization.cs | 144 ++++ .../Models/ContainerRegistryArchivePatch.cs | 66 ++ ...tainerRegistryCredentials.Serialization.cs | 5 +- .../Models/ContainerRegistryCredentials.cs | 20 +- .../Models/ContainerRegistryMetadataSearch.cs | 51 ++ ...ryNameAvailabilityContent.Serialization.cs | 28 +- ...ontainerRegistryNameAvailabilityContent.cs | 12 +- ...gistryNameAvailableResult.Serialization.cs | 36 +- .../ContainerRegistryNameAvailableResult.cs | 7 +- .../ContainerRegistryPatch.Serialization.cs | 32 + .../Models/ContainerRegistryPatch.cs | 12 +- .../Models/ContainerRegistryPipelineOption.cs | 57 ++ ...pelineRunSourceProperties.Serialization.cs | 200 ++++++ ...inerRegistryPipelineRunSourceProperties.cs | 71 ++ .../ContainerRegistryPipelineRunSourceType.cs | 48 ++ ...pelineRunTargetProperties.Serialization.cs | 200 ++++++ ...inerRegistryPipelineRunTargetProperties.cs | 71 ++ .../ContainerRegistryPipelineRunTargetType.cs | 48 ++ .../ContainerRegistryPipelineSourceType.cs | 48 ++ ...ContainerRegistryPolicies.Serialization.cs | 31 + .../Models/ContainerRegistryPolicies.cs | 8 +- .../ContainerRegistryProvisioningState.cs | 2 +- .../ContainerRegistryRoleAssignmentMode.cs | 51 ++ ...rRegistrySoftDeletePolicy.Serialization.cs | 227 ++++++ .../ContainerRegistrySoftDeletePolicy.cs | 76 ++ .../Models/ContainerRegistryTriggerStatus.cs | 8 +- .../ExportPipelineListResult.Serialization.cs | 219 ++++++ .../Models/ExportPipelineListResult.cs | 70 ++ ...tPipelineTargetProperties.Serialization.cs | 260 +++++++ .../Models/ExportPipelineTargetProperties.cs | 89 +++ .../ImportPipelineListResult.Serialization.cs | 219 ++++++ .../Models/ImportPipelineListResult.cs | 70 ++ ...tPipelineSourceProperties.Serialization.cs | 256 +++++++ .../Models/ImportPipelineSourceProperties.cs | 89 +++ .../Models/PipelineProgress.Serialization.cs | 170 +++++ .../src/Generated/Models/PipelineProgress.cs | 66 ++ .../PipelineRunListResult.Serialization.cs | 219 ++++++ .../Generated/Models/PipelineRunListResult.cs | 70 ++ .../Models/PipelineRunResult.Serialization.cs | 501 +++++++++++++ .../src/Generated/Models/PipelineRunResult.cs | 124 ++++ ...neSourceTriggerDescriptor.Serialization.cs | 167 +++++ .../Models/PipelineSourceTriggerDescriptor.cs | 66 ++ ...eSourceTriggerProperties.Serialization.cs} | 73 +- .../Models/PipelineSourceTriggerProperties.cs | 73 ++ ...PipelineTriggerDescriptor.Serialization.cs | 169 +++++ .../Models/PipelineTriggerDescriptor.cs | 71 ++ ...PipelineTriggerProperties.Serialization.cs | 169 +++++ .../Models/PipelineTriggerProperties.cs | 75 ++ ...SourceRegistryCredentials.Serialization.cs | 38 +- .../Models/SourceRegistryCredentials.cs | 17 +- .../src/Generated/Models/StorageAccessMode.cs | 51 ++ .../AgentPoolsRestOperations.cs | 4 +- .../ArchiveVersionsRestOperations.cs | 577 +++++++++++++++ .../RestOperations/ArchivesRestOperations.cs | 665 ++++++++++++++++++ .../RestOperations/BuildsRestOperations.cs | 2 +- .../CacheRulesRestOperations.cs | 2 +- .../ConnectedRegistriesRestOperations.cs | 210 +++--- .../CredentialSetsRestOperations.cs | 2 +- .../ExportPipelinesRestOperations.cs | 515 ++++++++++++++ .../ImportPipelinesRestOperations.cs | 515 ++++++++++++++ .../PipelineRunsRestOperations.cs | 515 ++++++++++++++ ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../RegistriesRestOperations.cs | 2 +- .../ReplicationsRestOperations.cs | 2 +- .../RestOperations/RunsRestOperations.cs | 24 +- .../RestOperations/SchedulesRestOperations.cs | 23 +- .../RestOperations/ScopeMapsRestOperations.cs | 2 +- .../RestOperations/TaskRunsRestOperations.cs | 4 +- .../RestOperations/TasksRestOperations.cs | 42 +- .../RestOperations/TokensRestOperations.cs | 2 +- .../RestOperations/WebhooksRestOperations.cs | 2 +- .../src/Generated/ScopeMapCollection.cs | 20 +- .../src/Generated/ScopeMapResource.cs | 12 +- .../src/autorest.md | 2 +- sdk/storage/ci.yml | 2 + 196 files changed, 20707 insertions(+), 927 deletions(-) create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveVersionOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryExportPipelineOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryImportPipelineOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs delete mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryRunOperationSource.cs delete mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryTaskOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceType.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.cs delete mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPropertiesActivation.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryMetadataSearch.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineOption.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceType.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetType.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineSourceType.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryRoleAssignmentMode.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs rename sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/{ConnectedRegistryPropertiesActivation.Serialization.cs => PipelineSourceTriggerProperties.Serialization.cs} (55%) create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/StorageAccessMode.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchiveVersionsRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchivesRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.net8.0.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.net8.0.cs index 8f863034c3b7..a4d679ef3f6b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.net8.0.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.net8.0.cs @@ -126,6 +126,108 @@ protected ContainerRegistryAgentPoolResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class ContainerRegistryArchiveCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryArchiveCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string archiveName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string archiveName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryArchiveData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchiveData() { } + public Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties PackageSource { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public string PublishedVersion { get { throw null; } set { } } + public string RepositoryEndpoint { get { throw null; } } + public string RepositoryEndpointPrefix { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryArchiveResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryArchiveResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetContainerRegistryArchiveVersion(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryArchiveVersionAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionCollection GetContainerRegistryArchiveVersions() { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerRegistryArchiveVersionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryArchiveVersionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryArchiveVersionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchiveVersionData() { } + public string ArchiveVersionErrorMessage { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryArchiveVersionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryArchiveVersionResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryCacheRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerRegistryCacheRuleCollection() { } @@ -248,6 +350,7 @@ protected ContainerRegistryCredentialSetResource() { } public partial class ContainerRegistryData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryData(Azure.Core.AzureLocation location, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku) { } + public Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } public System.DateTimeOffset? CreatedOn { get { throw null; } } public System.Collections.Generic.IReadOnlyList DataEndpointHostNames { get { throw null; } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption Encryption { get { throw null; } set { } } @@ -256,12 +359,14 @@ public ContainerRegistryData(Azure.Core.AzureLocation location, Azure.ResourceMa public bool? IsAnonymousPullEnabled { get { throw null; } set { } } public bool? IsDataEndpointEnabled { get { throw null; } set { } } public string LoginServer { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? MetadataSearch { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet NetworkRuleSet { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies Policies { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode? RoleAssignmentMode { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku Sku { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus Status { get { throw null; } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? ZoneRedundancy { get { throw null; } set { } } @@ -272,6 +377,57 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryExportPipelineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryExportPipelineCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string exportPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string exportPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryExportPipelineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryExportPipelineData() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public System.Collections.Generic.IList Options { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties Target { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryExportPipelineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryExportPipelineResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class ContainerRegistryExtensions { public static Azure.Response CheckContainerRegistryNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -282,9 +438,14 @@ public static partial class ContainerRegistryExtensions public static Azure.AsyncPageable GetContainerRegistriesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetContainerRegistry(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string registryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolResource GetContainerRegistryAgentPoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static System.Threading.Tasks.Task> GetContainerRegistryAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string registryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource GetContainerRegistryCacheRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetResource GetContainerRegistryCredentialSetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionResource GetContainerRegistryPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationResource GetContainerRegistryReplicationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -296,6 +457,108 @@ public static partial class ContainerRegistryExtensions public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryWebhookResource GetContainerRegistryWebhookResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ScopeMapResource GetScopeMapResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } + public partial class ContainerRegistryImportPipelineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryImportPipelineCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string importPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string importPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryImportPipelineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryImportPipelineData() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public System.Collections.Generic.IList Options { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties Source { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? SourceTriggerStatus { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryImportPipelineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryImportPipelineResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerRegistryPipelineRunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryPipelineRunCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string pipelineRunName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string pipelineRunName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryPipelineRunData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunData() { } + public string ForceUpdateTag { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent Request { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult Response { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryPipelineRunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryPipelineRunResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerRegistryPrivateEndpointConnectionCollection() { } @@ -467,12 +730,24 @@ protected ContainerRegistryResource() { } public virtual Azure.Response GetContainerRegistryAgentPool(string agentPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryAgentPoolAsync(string agentPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolCollection GetContainerRegistryAgentPools() { throw null; } + public virtual Azure.Response GetContainerRegistryArchive(string packageType, string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryArchiveAsync(string packageType, string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveCollection GetContainerRegistryArchives(string packageType) { throw null; } public virtual Azure.Response GetContainerRegistryCacheRule(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryCacheRuleAsync(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleCollection GetContainerRegistryCacheRules() { throw null; } public virtual Azure.Response GetContainerRegistryCredentialSet(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryCredentialSetAsync(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetCollection GetContainerRegistryCredentialSets() { throw null; } + public virtual Azure.Response GetContainerRegistryExportPipeline(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryExportPipelineAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineCollection GetContainerRegistryExportPipelines() { throw null; } + public virtual Azure.Response GetContainerRegistryImportPipeline(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryImportPipelineAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineCollection GetContainerRegistryImportPipelines() { throw null; } + public virtual Azure.Response GetContainerRegistryPipelineRun(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryPipelineRunAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunCollection GetContainerRegistryPipelineRuns() { throw null; } public virtual Azure.Response GetContainerRegistryPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionCollection GetContainerRegistryPrivateEndpointConnections() { throw null; } @@ -510,8 +785,8 @@ protected ContainerRegistryResource() { } public virtual System.Threading.Tasks.Task> RegenerateCredentialAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialRegenerateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation ScheduleRun(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ScheduleRunAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ScheduleRun(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ScheduleRunAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.ContainerRegistry.ContainerRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -575,8 +850,8 @@ public partial class ContainerRegistryRunResource : Azure.ResourceManager.ArmRes protected ContainerRegistryRunResource() { } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.ResourceManager.ArmOperation Cancel(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task CancelAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Cancel(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CancelAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string runId) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -587,8 +862,8 @@ protected ContainerRegistryRunResource() { } Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ContainerRegistryTaskCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -654,8 +929,8 @@ protected ContainerRegistryTaskResource() { } Azure.ResourceManager.ContainerRegistry.ContainerRegistryTaskData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ContainerRegistryTaskRunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -883,8 +1158,13 @@ public partial class MockableContainerRegistryArmClient : Azure.ResourceManager. protected MockableContainerRegistryArmClient() { } public virtual Azure.ResourceManager.ContainerRegistry.ConnectedRegistryResource GetConnectedRegistryResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolResource GetContainerRegistryAgentPoolResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource GetContainerRegistryCacheRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetResource GetContainerRegistryCredentialSetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionResource GetContainerRegistryPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationResource GetContainerRegistryReplicationResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -950,6 +1230,35 @@ namespace Azure.ResourceManager.ContainerRegistry.Models public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ActionsRequiredForPrivateLinkServiceConsumer left, Azure.ResourceManager.ContainerRegistry.Models.ActionsRequiredForPrivateLinkServiceConsumer right) { throw null; } public override string ToString() { throw null; } } + public partial class ArchivePackageSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArchivePackageSourceProperties() { } + public Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType? SourceType { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ArchivePackageSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ArchivePackageSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType Remote { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType right) { throw null; } + public override string ToString() { throw null; } + } public static partial class ArmContainerRegistryModelFactory { public static Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData ConnectedRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode? mode = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode?), string version = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState? connectionState = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState?), System.DateTimeOffset? lastActivityOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus? activationStatus = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryParent parent = null, System.Collections.Generic.IEnumerable clientTokenIds = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer loginServer = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging logging = null, System.Collections.Generic.IEnumerable statusDetails = null, System.Collections.Generic.IEnumerable notificationsList = null, Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties garbageCollection = null) { throw null; } @@ -958,6 +1267,8 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties ConnectedRegistrySyncProperties(Azure.Core.ResourceIdentifier tokenId = null, string schedule = null, System.TimeSpan? syncWindow = default(System.TimeSpan?), System.TimeSpan messageTtl = default(System.TimeSpan), System.DateTimeOffset? lastSyncOn = default(System.DateTimeOffset?), string gatewayEndpoint = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolData ContainerRegistryAgentPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), int? count = default(int?), string tier = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS? os = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS?), Azure.Core.ResourceIdentifier virtualNetworkSubnetResourceId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolQueueStatus ContainerRegistryAgentPoolQueueStatus(int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData ContainerRegistryArchiveData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties packageSource = null, string publishedVersion = null, string repositoryEndpointPrefix = null, string repositoryEndpoint = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData ContainerRegistryArchiveVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), string archiveVersionErrorMessage = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAuthCredential ContainerRegistryAuthCredential(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName? name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName?), string usernameSecretIdentifier = null, string passwordSecretIdentifier = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth credentialHealth = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependency ContainerRegistryBaseImageDependency(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependencyType? dependencyType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependencyType?), string registry = null, string repository = null, string tag = null, string digest = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerUpdateContent ContainerRegistryBaseImageTriggerUpdateContent(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerType? baseImageTriggerType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerType?), string updateTriggerEndpoint = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUpdateTriggerPayloadType? updateTriggerPayloadType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUpdateTriggerPayloadType?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), string name = null) { throw null; } @@ -966,19 +1277,28 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData ContainerRegistryCredentialSetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.Collections.Generic.IEnumerable authCredentials = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string loginServer, System.DateTimeOffset? createdOn, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, System.Collections.Generic.IEnumerable dataEndpointHostNames, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = default(bool?), System.Collections.Generic.IEnumerable dataEndpointHostNames = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?), bool? isAnonymousPullEnabled = default(bool?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string loginServer, System.DateTimeOffset? createdOn, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, System.Collections.Generic.IEnumerable dataEndpointHostNames, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy, bool? isAnonymousPullEnabled) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = default(bool?), System.Collections.Generic.IEnumerable dataEndpointHostNames = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?), bool? isAnonymousPullEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? metadataSearch = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch?), Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode? roleAssignmentMode = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryDockerBuildStep ContainerRegistryDockerBuildStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, System.Collections.Generic.IEnumerable imageNames = null, bool? isPushEnabled = default(bool?), bool? noCache = default(bool?), string dockerFilePath = null, string target = null, System.Collections.Generic.IEnumerable arguments = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncodedTaskStep ContainerRegistryEncodedTaskStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, string encodedTaskContent = null, string encodedValuesContent = null, System.Collections.Generic.IEnumerable values = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData ContainerRegistryExportPipelineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties target = null, System.Collections.Generic.IEnumerable options = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryFileTaskStep ContainerRegistryFileTaskStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, string taskFilePath = null, string valuesFilePath = null, System.Collections.Generic.IEnumerable values = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryGenerateCredentialsResult ContainerRegistryGenerateCredentialsResult(string username = null, System.Collections.Generic.IEnumerable passwords = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportImageContent ContainerRegistryImportImageContent(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSource source = null, System.Collections.Generic.IEnumerable targetTags = null, System.Collections.Generic.IEnumerable untaggedTargetRepositories = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportMode? mode = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportMode?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData ContainerRegistryImportPipelineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties source = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? sourceTriggerStatus = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), System.Collections.Generic.IEnumerable options = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSource ContainerRegistryImportSource(Azure.Core.ResourceIdentifier resourceId = null, string registryAddress = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSourceCredentials credentials = null, string sourceImage = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSourceCredentials ContainerRegistryImportSourceCredentials(string username = null, string password = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryKeyVaultProperties ContainerRegistryKeyVaultProperties(string keyIdentifier = null, string versionedKeyIdentifier = null, string identity = null, bool? isKeyRotationEnabled = default(bool?), System.DateTimeOffset? lastKeyRotationTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryListCredentialsResult ContainerRegistryListCredentialsResult(string username = null, System.Collections.Generic.IEnumerable passwords = null) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType)) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType), string resourceGroupName = null, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable, string reason, string message) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(string availableLoginServerName = null, bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPassword ContainerRegistryPassword(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPasswordName? name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPasswordName?), string value = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData ContainerRegistryPipelineRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent request = null, Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult response = null, string forceUpdateTag = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionData ContainerRegistryPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResourceData ContainerRegistryPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationData ContainerRegistryReplicationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isRegionEndpointEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?)) { throw null; } @@ -987,6 +1307,7 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData ContainerRegistryRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string runId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunStatus?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunType? runType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunType?), string agentPoolName = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? finishOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable outputImages = null, string task = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImageUpdateTrigger imageUpdateTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySourceTriggerDescriptor sourceTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTimerTriggerDescriptor timerTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPlatformProperties platform = null, int? agentCpu = default(int?), string sourceRegistryAuth = null, System.Collections.Generic.IEnumerable customRegistries = null, string runErrorMessage = null, string updateTriggerToken = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImageDescriptor logArtifact = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), bool? isArchiveEnabled = default(bool?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunGetLogResult ContainerRegistryRunGetLogResult(string logLink = null, string logArtifactLink = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku ContainerRegistrySku(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuName name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuName), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier? tier = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy ContainerRegistrySoftDeletePolicy(int? retentionDays = default(int?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySourceTriggerUpdateContent ContainerRegistrySourceTriggerUpdateContent(Azure.ResourceManager.ContainerRegistry.Models.SourceCodeRepoUpdateContent sourceRepository = null, System.Collections.Generic.IEnumerable sourceTriggerEvents = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), string name = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryTaskData ContainerRegistryTaskData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStatus?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPlatformProperties platform = null, int? agentCpu = default(int?), string agentPoolName = null, int? timeoutInSeconds = default(int?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStepProperties step = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerProperties trigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentials credentials = null, string logTemplate = null, bool? isSystemTask = default(bool?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryTaskRunData ContainerRegistryTaskRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent runRequest = null, Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData runResult = null, string forceUpdateTag = null) { throw null; } @@ -1008,10 +1329,32 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventResponseMessage ContainerRegistryWebhookEventResponseMessage(string content = null, System.Collections.Generic.IReadOnlyDictionary headers = null, string reasonPhrase = null, string statusCode = null, string version = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventSource ContainerRegistryWebhookEventSource(string addr = null, string instanceId = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventTarget ContainerRegistryWebhookEventTarget(string mediaType = null, long? size = default(long?), string digest = null, long? length = default(long?), string repository = null, System.Uri uri = null, string tag = null, string name = null, string version = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult PipelineRunResult(string status = null, System.Collections.Generic.IEnumerable importedArtifacts = null, string progressPercentage = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? finishOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties source = null, Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties target = null, string catalogDigest = null, System.DateTimeOffset? sourceTriggerTimestamp = default(System.DateTimeOffset?), string pipelineRunErrorMessage = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ScopeMapData ScopeMapData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string description = null, string scopeMapType = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), System.Collections.Generic.IEnumerable actions = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.SourceUploadDefinition SourceUploadDefinition(System.Uri uploadUri = null, string relativePath = null) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoGeneratedDomainNameLabelScope(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope NoReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope TenantReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope Unsecure { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ConnectedRegistryActivationStatus : System.IEquatable { private readonly object _dummy; @@ -1159,6 +1502,21 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ConnectedRegistryPipelineRunContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryPipelineRunContent() { } + public System.Collections.Generic.IList Artifacts { get { throw null; } } + public string CatalogDigest { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PipelineResourceId { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties Source { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties Target { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ConnectedRegistryStatusDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ConnectedRegistryStatusDetail() { } @@ -1226,6 +1584,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryArchivePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchivePatch() { } + public string PublishedVersion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistryAuthCredential : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryAuthCredential() { } @@ -1431,7 +1800,7 @@ public partial class ContainerRegistryCredentials : System.ClientModel.Primitive { public ContainerRegistryCredentials() { } public System.Collections.Generic.IDictionary CustomRegistries { get { throw null; } } - public Azure.ResourceManager.ContainerRegistry.Models.SourceRegistryLoginMode? SourceRegistryLoginMode { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.SourceRegistryCredentials SourceRegistry { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1809,10 +2178,30 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryMetadataSearch : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryMetadataSearch(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch Disabled { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryNameAvailabilityContent(string name) { } + public Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } public string Name { get { throw null; } } + public string ResourceGroupName { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType ResourceType { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1824,6 +2213,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerRegistryNameAvailableResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryNameAvailableResult() { } + public string AvailableLoginServerName { get { throw null; } } public bool? IsNameAvailable { get { throw null; } } public string Message { get { throw null; } } public string Reason { get { throw null; } } @@ -1962,10 +2352,12 @@ public ContainerRegistryPatch() { } public bool? IsAdminUserEnabled { get { throw null; } set { } } public bool? IsAnonymousPullEnabled { get { throw null; } set { } } public bool? IsDataEndpointEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? MetadataSearch { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet NetworkRuleSet { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies Policies { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode? RoleAssignmentMode { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku Sku { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1975,6 +2367,101 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineOption(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption ContinueOnErrors { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption DeleteSourceBlobOnSuccess { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption OverwriteBlobs { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption OverwriteTags { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerRegistryPipelineRunSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunSourceProperties() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType? SourceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineRunSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineRunSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType AzureStorageBlob { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerRegistryPipelineRunTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunTargetProperties() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType? TargetType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineRunTargetType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineRunTargetType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType AzureStorageBlob { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType AzureStorageBlobContainer { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryPlatformProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryPlatformProperties(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS os) { } @@ -2008,6 +2495,7 @@ public ContainerRegistryPolicies() { } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryExportPolicyStatus? ExportStatus { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? QuarantineStatus { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRetentionPolicy RetentionPolicy { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy SoftDeletePolicy { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTrustPolicy TrustPolicy { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2162,6 +2650,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryRoleAssignmentMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryRoleAssignmentMode(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode AbacRepositoryPermissions { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode LegacyRegistryPermissions { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryRunArgument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryRunArgument(string name, string value) { } @@ -2337,6 +2843,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier right) { throw null; } public override string ToString() { throw null; } } + public partial class ContainerRegistrySoftDeletePolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistrySoftDeletePolicy() { } + public System.DateTimeOffset? LastUpdatedOn { get { throw null; } } + public int? RetentionDays { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistrySourceTrigger : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistrySourceTrigger(Azure.ResourceManager.ContainerRegistry.Models.SourceCodeRepoProperties sourceRepository, System.Collections.Generic.IEnumerable sourceTriggerEvents, string name) { } @@ -3045,6 +3564,20 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ExportPipelineTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportPipelineTargetProperties() { } + public System.Uri KeyVaultUri { get { throw null; } set { } } + public string PipelineTargetType { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode? StorageAccessMode { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class GarbageCollectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GarbageCollectionProperties() { } @@ -3057,6 +3590,40 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ImportPipelineSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImportPipelineSourceProperties() { } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType? ContainerRegistryPipelineSourceType { get { throw null; } set { } } + public System.Uri KeyVaultUri { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode? StorageAccessMode { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineRunResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PipelineRunResult() { } + public string CatalogDigest { get { throw null; } } + public System.DateTimeOffset? FinishOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ImportedArtifacts { get { throw null; } } + public string PipelineRunErrorMessage { get { throw null; } } + public string ProgressPercentage { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties Source { get { throw null; } } + public System.DateTimeOffset? SourceTriggerTimestamp { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string Status { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ScopeMapPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ScopeMapPatch() { } @@ -3163,6 +3730,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.SourceControlType left, Azure.ResourceManager.ContainerRegistry.Models.SourceControlType right) { throw null; } public override string ToString() { throw null; } } + public partial class SourceRegistryCredentials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SourceRegistryCredentials() { } + public string Identity { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.SourceRegistryLoginMode? LoginMode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.SourceRegistryCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.SourceRegistryCredentials System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct SourceRegistryLoginMode : System.IEquatable { @@ -3193,4 +3772,22 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageAccessMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageAccessMode(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode ManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode SasToken { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode left, Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode left, Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode right) { throw null; } + public override string ToString() { throw null; } + } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.netstandard2.0.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.netstandard2.0.cs index 8f863034c3b7..a4d679ef3f6b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.netstandard2.0.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.netstandard2.0.cs @@ -126,6 +126,108 @@ protected ContainerRegistryAgentPoolResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class ContainerRegistryArchiveCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryArchiveCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string archiveName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string archiveName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryArchiveData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchiveData() { } + public Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties PackageSource { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public string PublishedVersion { get { throw null; } set { } } + public string RepositoryEndpoint { get { throw null; } } + public string RepositoryEndpointPrefix { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryArchiveResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryArchiveResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetContainerRegistryArchiveVersion(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryArchiveVersionAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionCollection GetContainerRegistryArchiveVersions() { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerRegistryArchiveVersionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryArchiveVersionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryArchiveVersionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchiveVersionData() { } + public string ArchiveVersionErrorMessage { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryArchiveVersionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryArchiveVersionResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryCacheRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerRegistryCacheRuleCollection() { } @@ -248,6 +350,7 @@ protected ContainerRegistryCredentialSetResource() { } public partial class ContainerRegistryData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryData(Azure.Core.AzureLocation location, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku) { } + public Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } public System.DateTimeOffset? CreatedOn { get { throw null; } } public System.Collections.Generic.IReadOnlyList DataEndpointHostNames { get { throw null; } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption Encryption { get { throw null; } set { } } @@ -256,12 +359,14 @@ public ContainerRegistryData(Azure.Core.AzureLocation location, Azure.ResourceMa public bool? IsAnonymousPullEnabled { get { throw null; } set { } } public bool? IsDataEndpointEnabled { get { throw null; } set { } } public string LoginServer { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? MetadataSearch { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet NetworkRuleSet { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies Policies { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode? RoleAssignmentMode { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku Sku { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus Status { get { throw null; } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? ZoneRedundancy { get { throw null; } set { } } @@ -272,6 +377,57 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryExportPipelineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryExportPipelineCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string exportPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string exportPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryExportPipelineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryExportPipelineData() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public System.Collections.Generic.IList Options { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties Target { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryExportPipelineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryExportPipelineResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class ContainerRegistryExtensions { public static Azure.Response CheckContainerRegistryNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -282,9 +438,14 @@ public static partial class ContainerRegistryExtensions public static Azure.AsyncPageable GetContainerRegistriesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetContainerRegistry(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string registryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolResource GetContainerRegistryAgentPoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static System.Threading.Tasks.Task> GetContainerRegistryAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string registryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource GetContainerRegistryCacheRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetResource GetContainerRegistryCredentialSetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionResource GetContainerRegistryPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationResource GetContainerRegistryReplicationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -296,6 +457,108 @@ public static partial class ContainerRegistryExtensions public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryWebhookResource GetContainerRegistryWebhookResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ScopeMapResource GetScopeMapResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } + public partial class ContainerRegistryImportPipelineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryImportPipelineCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string importPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string importPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryImportPipelineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryImportPipelineData() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public System.Collections.Generic.IList Options { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties Source { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? SourceTriggerStatus { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryImportPipelineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryImportPipelineResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerRegistryPipelineRunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryPipelineRunCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string pipelineRunName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string pipelineRunName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryPipelineRunData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunData() { } + public string ForceUpdateTag { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent Request { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult Response { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryPipelineRunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryPipelineRunResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerRegistryPrivateEndpointConnectionCollection() { } @@ -467,12 +730,24 @@ protected ContainerRegistryResource() { } public virtual Azure.Response GetContainerRegistryAgentPool(string agentPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryAgentPoolAsync(string agentPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolCollection GetContainerRegistryAgentPools() { throw null; } + public virtual Azure.Response GetContainerRegistryArchive(string packageType, string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryArchiveAsync(string packageType, string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveCollection GetContainerRegistryArchives(string packageType) { throw null; } public virtual Azure.Response GetContainerRegistryCacheRule(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryCacheRuleAsync(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleCollection GetContainerRegistryCacheRules() { throw null; } public virtual Azure.Response GetContainerRegistryCredentialSet(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryCredentialSetAsync(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetCollection GetContainerRegistryCredentialSets() { throw null; } + public virtual Azure.Response GetContainerRegistryExportPipeline(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryExportPipelineAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineCollection GetContainerRegistryExportPipelines() { throw null; } + public virtual Azure.Response GetContainerRegistryImportPipeline(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryImportPipelineAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineCollection GetContainerRegistryImportPipelines() { throw null; } + public virtual Azure.Response GetContainerRegistryPipelineRun(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryPipelineRunAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunCollection GetContainerRegistryPipelineRuns() { throw null; } public virtual Azure.Response GetContainerRegistryPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionCollection GetContainerRegistryPrivateEndpointConnections() { throw null; } @@ -510,8 +785,8 @@ protected ContainerRegistryResource() { } public virtual System.Threading.Tasks.Task> RegenerateCredentialAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialRegenerateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation ScheduleRun(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ScheduleRunAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ScheduleRun(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ScheduleRunAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.ContainerRegistry.ContainerRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -575,8 +850,8 @@ public partial class ContainerRegistryRunResource : Azure.ResourceManager.ArmRes protected ContainerRegistryRunResource() { } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.ResourceManager.ArmOperation Cancel(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task CancelAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Cancel(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CancelAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string runId) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -587,8 +862,8 @@ protected ContainerRegistryRunResource() { } Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ContainerRegistryTaskCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -654,8 +929,8 @@ protected ContainerRegistryTaskResource() { } Azure.ResourceManager.ContainerRegistry.ContainerRegistryTaskData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ContainerRegistryTaskRunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -883,8 +1158,13 @@ public partial class MockableContainerRegistryArmClient : Azure.ResourceManager. protected MockableContainerRegistryArmClient() { } public virtual Azure.ResourceManager.ContainerRegistry.ConnectedRegistryResource GetConnectedRegistryResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolResource GetContainerRegistryAgentPoolResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource GetContainerRegistryCacheRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetResource GetContainerRegistryCredentialSetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionResource GetContainerRegistryPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationResource GetContainerRegistryReplicationResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -950,6 +1230,35 @@ namespace Azure.ResourceManager.ContainerRegistry.Models public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ActionsRequiredForPrivateLinkServiceConsumer left, Azure.ResourceManager.ContainerRegistry.Models.ActionsRequiredForPrivateLinkServiceConsumer right) { throw null; } public override string ToString() { throw null; } } + public partial class ArchivePackageSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArchivePackageSourceProperties() { } + public Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType? SourceType { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ArchivePackageSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ArchivePackageSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType Remote { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType right) { throw null; } + public override string ToString() { throw null; } + } public static partial class ArmContainerRegistryModelFactory { public static Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData ConnectedRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode? mode = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode?), string version = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState? connectionState = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState?), System.DateTimeOffset? lastActivityOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus? activationStatus = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryParent parent = null, System.Collections.Generic.IEnumerable clientTokenIds = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer loginServer = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging logging = null, System.Collections.Generic.IEnumerable statusDetails = null, System.Collections.Generic.IEnumerable notificationsList = null, Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties garbageCollection = null) { throw null; } @@ -958,6 +1267,8 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties ConnectedRegistrySyncProperties(Azure.Core.ResourceIdentifier tokenId = null, string schedule = null, System.TimeSpan? syncWindow = default(System.TimeSpan?), System.TimeSpan messageTtl = default(System.TimeSpan), System.DateTimeOffset? lastSyncOn = default(System.DateTimeOffset?), string gatewayEndpoint = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolData ContainerRegistryAgentPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), int? count = default(int?), string tier = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS? os = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS?), Azure.Core.ResourceIdentifier virtualNetworkSubnetResourceId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolQueueStatus ContainerRegistryAgentPoolQueueStatus(int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData ContainerRegistryArchiveData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties packageSource = null, string publishedVersion = null, string repositoryEndpointPrefix = null, string repositoryEndpoint = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData ContainerRegistryArchiveVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), string archiveVersionErrorMessage = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAuthCredential ContainerRegistryAuthCredential(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName? name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName?), string usernameSecretIdentifier = null, string passwordSecretIdentifier = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth credentialHealth = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependency ContainerRegistryBaseImageDependency(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependencyType? dependencyType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependencyType?), string registry = null, string repository = null, string tag = null, string digest = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerUpdateContent ContainerRegistryBaseImageTriggerUpdateContent(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerType? baseImageTriggerType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerType?), string updateTriggerEndpoint = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUpdateTriggerPayloadType? updateTriggerPayloadType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUpdateTriggerPayloadType?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), string name = null) { throw null; } @@ -966,19 +1277,28 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData ContainerRegistryCredentialSetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.Collections.Generic.IEnumerable authCredentials = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string loginServer, System.DateTimeOffset? createdOn, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, System.Collections.Generic.IEnumerable dataEndpointHostNames, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = default(bool?), System.Collections.Generic.IEnumerable dataEndpointHostNames = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?), bool? isAnonymousPullEnabled = default(bool?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string loginServer, System.DateTimeOffset? createdOn, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, System.Collections.Generic.IEnumerable dataEndpointHostNames, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy, bool? isAnonymousPullEnabled) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = default(bool?), System.Collections.Generic.IEnumerable dataEndpointHostNames = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?), bool? isAnonymousPullEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? metadataSearch = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch?), Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode? roleAssignmentMode = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryDockerBuildStep ContainerRegistryDockerBuildStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, System.Collections.Generic.IEnumerable imageNames = null, bool? isPushEnabled = default(bool?), bool? noCache = default(bool?), string dockerFilePath = null, string target = null, System.Collections.Generic.IEnumerable arguments = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncodedTaskStep ContainerRegistryEncodedTaskStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, string encodedTaskContent = null, string encodedValuesContent = null, System.Collections.Generic.IEnumerable values = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData ContainerRegistryExportPipelineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties target = null, System.Collections.Generic.IEnumerable options = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryFileTaskStep ContainerRegistryFileTaskStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, string taskFilePath = null, string valuesFilePath = null, System.Collections.Generic.IEnumerable values = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryGenerateCredentialsResult ContainerRegistryGenerateCredentialsResult(string username = null, System.Collections.Generic.IEnumerable passwords = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportImageContent ContainerRegistryImportImageContent(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSource source = null, System.Collections.Generic.IEnumerable targetTags = null, System.Collections.Generic.IEnumerable untaggedTargetRepositories = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportMode? mode = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportMode?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData ContainerRegistryImportPipelineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties source = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? sourceTriggerStatus = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), System.Collections.Generic.IEnumerable options = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSource ContainerRegistryImportSource(Azure.Core.ResourceIdentifier resourceId = null, string registryAddress = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSourceCredentials credentials = null, string sourceImage = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSourceCredentials ContainerRegistryImportSourceCredentials(string username = null, string password = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryKeyVaultProperties ContainerRegistryKeyVaultProperties(string keyIdentifier = null, string versionedKeyIdentifier = null, string identity = null, bool? isKeyRotationEnabled = default(bool?), System.DateTimeOffset? lastKeyRotationTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryListCredentialsResult ContainerRegistryListCredentialsResult(string username = null, System.Collections.Generic.IEnumerable passwords = null) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType)) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType), string resourceGroupName = null, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable, string reason, string message) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(string availableLoginServerName = null, bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPassword ContainerRegistryPassword(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPasswordName? name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPasswordName?), string value = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData ContainerRegistryPipelineRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent request = null, Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult response = null, string forceUpdateTag = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionData ContainerRegistryPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResourceData ContainerRegistryPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationData ContainerRegistryReplicationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isRegionEndpointEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?)) { throw null; } @@ -987,6 +1307,7 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData ContainerRegistryRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string runId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunStatus?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunType? runType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunType?), string agentPoolName = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? finishOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable outputImages = null, string task = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImageUpdateTrigger imageUpdateTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySourceTriggerDescriptor sourceTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTimerTriggerDescriptor timerTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPlatformProperties platform = null, int? agentCpu = default(int?), string sourceRegistryAuth = null, System.Collections.Generic.IEnumerable customRegistries = null, string runErrorMessage = null, string updateTriggerToken = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImageDescriptor logArtifact = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), bool? isArchiveEnabled = default(bool?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunGetLogResult ContainerRegistryRunGetLogResult(string logLink = null, string logArtifactLink = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku ContainerRegistrySku(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuName name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuName), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier? tier = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy ContainerRegistrySoftDeletePolicy(int? retentionDays = default(int?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySourceTriggerUpdateContent ContainerRegistrySourceTriggerUpdateContent(Azure.ResourceManager.ContainerRegistry.Models.SourceCodeRepoUpdateContent sourceRepository = null, System.Collections.Generic.IEnumerable sourceTriggerEvents = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), string name = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryTaskData ContainerRegistryTaskData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStatus?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPlatformProperties platform = null, int? agentCpu = default(int?), string agentPoolName = null, int? timeoutInSeconds = default(int?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStepProperties step = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerProperties trigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentials credentials = null, string logTemplate = null, bool? isSystemTask = default(bool?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryTaskRunData ContainerRegistryTaskRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent runRequest = null, Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData runResult = null, string forceUpdateTag = null) { throw null; } @@ -1008,10 +1329,32 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventResponseMessage ContainerRegistryWebhookEventResponseMessage(string content = null, System.Collections.Generic.IReadOnlyDictionary headers = null, string reasonPhrase = null, string statusCode = null, string version = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventSource ContainerRegistryWebhookEventSource(string addr = null, string instanceId = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventTarget ContainerRegistryWebhookEventTarget(string mediaType = null, long? size = default(long?), string digest = null, long? length = default(long?), string repository = null, System.Uri uri = null, string tag = null, string name = null, string version = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult PipelineRunResult(string status = null, System.Collections.Generic.IEnumerable importedArtifacts = null, string progressPercentage = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? finishOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties source = null, Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties target = null, string catalogDigest = null, System.DateTimeOffset? sourceTriggerTimestamp = default(System.DateTimeOffset?), string pipelineRunErrorMessage = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ScopeMapData ScopeMapData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string description = null, string scopeMapType = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), System.Collections.Generic.IEnumerable actions = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.SourceUploadDefinition SourceUploadDefinition(System.Uri uploadUri = null, string relativePath = null) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoGeneratedDomainNameLabelScope(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope NoReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope TenantReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope Unsecure { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ConnectedRegistryActivationStatus : System.IEquatable { private readonly object _dummy; @@ -1159,6 +1502,21 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ConnectedRegistryPipelineRunContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryPipelineRunContent() { } + public System.Collections.Generic.IList Artifacts { get { throw null; } } + public string CatalogDigest { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PipelineResourceId { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties Source { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties Target { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ConnectedRegistryStatusDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ConnectedRegistryStatusDetail() { } @@ -1226,6 +1584,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryArchivePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchivePatch() { } + public string PublishedVersion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistryAuthCredential : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryAuthCredential() { } @@ -1431,7 +1800,7 @@ public partial class ContainerRegistryCredentials : System.ClientModel.Primitive { public ContainerRegistryCredentials() { } public System.Collections.Generic.IDictionary CustomRegistries { get { throw null; } } - public Azure.ResourceManager.ContainerRegistry.Models.SourceRegistryLoginMode? SourceRegistryLoginMode { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.SourceRegistryCredentials SourceRegistry { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1809,10 +2178,30 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryMetadataSearch : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryMetadataSearch(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch Disabled { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryNameAvailabilityContent(string name) { } + public Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } public string Name { get { throw null; } } + public string ResourceGroupName { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType ResourceType { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1824,6 +2213,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerRegistryNameAvailableResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryNameAvailableResult() { } + public string AvailableLoginServerName { get { throw null; } } public bool? IsNameAvailable { get { throw null; } } public string Message { get { throw null; } } public string Reason { get { throw null; } } @@ -1962,10 +2352,12 @@ public ContainerRegistryPatch() { } public bool? IsAdminUserEnabled { get { throw null; } set { } } public bool? IsAnonymousPullEnabled { get { throw null; } set { } } public bool? IsDataEndpointEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? MetadataSearch { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet NetworkRuleSet { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies Policies { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode? RoleAssignmentMode { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku Sku { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1975,6 +2367,101 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineOption(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption ContinueOnErrors { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption DeleteSourceBlobOnSuccess { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption OverwriteBlobs { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption OverwriteTags { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerRegistryPipelineRunSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunSourceProperties() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType? SourceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineRunSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineRunSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType AzureStorageBlob { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerRegistryPipelineRunTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunTargetProperties() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType? TargetType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineRunTargetType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineRunTargetType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType AzureStorageBlob { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType AzureStorageBlobContainer { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryPlatformProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryPlatformProperties(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS os) { } @@ -2008,6 +2495,7 @@ public ContainerRegistryPolicies() { } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryExportPolicyStatus? ExportStatus { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? QuarantineStatus { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRetentionPolicy RetentionPolicy { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy SoftDeletePolicy { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTrustPolicy TrustPolicy { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2162,6 +2650,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryRoleAssignmentMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryRoleAssignmentMode(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode AbacRepositoryPermissions { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode LegacyRegistryPermissions { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRoleAssignmentMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryRunArgument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryRunArgument(string name, string value) { } @@ -2337,6 +2843,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier right) { throw null; } public override string ToString() { throw null; } } + public partial class ContainerRegistrySoftDeletePolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistrySoftDeletePolicy() { } + public System.DateTimeOffset? LastUpdatedOn { get { throw null; } } + public int? RetentionDays { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistrySourceTrigger : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistrySourceTrigger(Azure.ResourceManager.ContainerRegistry.Models.SourceCodeRepoProperties sourceRepository, System.Collections.Generic.IEnumerable sourceTriggerEvents, string name) { } @@ -3045,6 +3564,20 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ExportPipelineTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportPipelineTargetProperties() { } + public System.Uri KeyVaultUri { get { throw null; } set { } } + public string PipelineTargetType { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode? StorageAccessMode { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class GarbageCollectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GarbageCollectionProperties() { } @@ -3057,6 +3590,40 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ImportPipelineSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImportPipelineSourceProperties() { } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType? ContainerRegistryPipelineSourceType { get { throw null; } set { } } + public System.Uri KeyVaultUri { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode? StorageAccessMode { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineRunResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PipelineRunResult() { } + public string CatalogDigest { get { throw null; } } + public System.DateTimeOffset? FinishOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ImportedArtifacts { get { throw null; } } + public string PipelineRunErrorMessage { get { throw null; } } + public string ProgressPercentage { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties Source { get { throw null; } } + public System.DateTimeOffset? SourceTriggerTimestamp { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string Status { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ScopeMapPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ScopeMapPatch() { } @@ -3163,6 +3730,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.SourceControlType left, Azure.ResourceManager.ContainerRegistry.Models.SourceControlType right) { throw null; } public override string ToString() { throw null; } } + public partial class SourceRegistryCredentials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SourceRegistryCredentials() { } + public string Identity { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.SourceRegistryLoginMode? LoginMode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.SourceRegistryCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.SourceRegistryCredentials System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct SourceRegistryLoginMode : System.IEquatable { @@ -3193,4 +3772,22 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageAccessMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageAccessMode(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode ManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode SasToken { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode left, Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode left, Azure.ResourceManager.ContainerRegistry.Models.StorageAccessMode right) { throw null; } + public override string ToString() { throw null; } + } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryCollection.cs index 3675d11bf38e..8e2f6c0bc496 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ConnectedRegistryCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ConnectedRegistryCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ConnectedRegistryCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ConnectedRegistryCreate.json // this example is just showing the usage of "ConnectedRegistries_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -72,7 +72,7 @@ public async Task CreateOrUpdate_ConnectedRegistryCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ConnectedRegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ConnectedRegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ConnectedRegistryGet.json // this example is just showing the usage of "ConnectedRegistries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task Get_ConnectedRegistryGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ConnectedRegistryList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ConnectedRegistryList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ConnectedRegistryList.json // this example is just showing the usage of "ConnectedRegistries_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,7 +142,7 @@ public async Task GetAll_ConnectedRegistryList() [Ignore("Only validating compilation of examples")] public async Task Exists_ConnectedRegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ConnectedRegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ConnectedRegistryGet.json // this example is just showing the usage of "ConnectedRegistries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task Exists_ConnectedRegistryGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ConnectedRegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ConnectedRegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ConnectedRegistryGet.json // this example is just showing the usage of "ConnectedRegistries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryResource.cs index c1d32285195b..27c3ec4c2fc2 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryResource.cs @@ -21,7 +21,7 @@ public partial class Sample_ConnectedRegistryResource [Ignore("Only validating compilation of examples")] public async Task Get_ConnectedRegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ConnectedRegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ConnectedRegistryGet.json // this example is just showing the usage of "ConnectedRegistries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_ConnectedRegistryGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ConnectedRegistryDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ConnectedRegistryDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ConnectedRegistryDelete.json // this example is just showing the usage of "ConnectedRegistries_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +79,7 @@ public async Task Delete_ConnectedRegistryDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ConnectedRegistryUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ConnectedRegistryUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ConnectedRegistryUpdate.json // this example is just showing the usage of "ConnectedRegistries_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task Update_ConnectedRegistryUpdate() [Ignore("Only validating compilation of examples")] public async Task Deactivate_ConnectedRegistryDeactivate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ConnectedRegistryDeactivate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ConnectedRegistryDeactivate.json // this example is just showing the usage of "ConnectedRegistries_Deactivate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryAgentPoolCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryAgentPoolCollection.cs index ad75e750ca85..0494249bb2d6 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryAgentPoolCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryAgentPoolCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryAgentPoolCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_AgentPoolsCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/AgentPoolsCreate.json // this example is just showing the usage of "AgentPools_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task CreateOrUpdate_AgentPoolsCreate() [Ignore("Only validating compilation of examples")] public async Task Get_AgentPoolsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/AgentPoolsGet.json // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Get_AgentPoolsGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_AgentPoolsList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/AgentPoolsList.json // this example is just showing the usage of "AgentPools_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task GetAll_AgentPoolsList() [Ignore("Only validating compilation of examples")] public async Task Exists_AgentPoolsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/AgentPoolsGet.json // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Exists_AgentPoolsGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_AgentPoolsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/AgentPoolsGet.json // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryAgentPoolResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryAgentPoolResource.cs index 5ffb01eff778..375df98fa872 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryAgentPoolResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryAgentPoolResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryAgentPoolResource [Ignore("Only validating compilation of examples")] public async Task Get_AgentPoolsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/AgentPoolsGet.json // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_AgentPoolsGet() [Ignore("Only validating compilation of examples")] public async Task Delete_AgentPoolsDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/AgentPoolsDelete.json // this example is just showing the usage of "AgentPools_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_AgentPoolsDelete() [Ignore("Only validating compilation of examples")] public async Task Update_AgentPoolsUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/AgentPoolsUpdate.json // this example is just showing the usage of "AgentPools_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task Update_AgentPoolsUpdate() [Ignore("Only validating compilation of examples")] public async Task GetQueueStatus_AgentPoolsGetQueueStatus() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGetQueueStatus.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/AgentPoolsGetQueueStatus.json // this example is just showing the usage of "AgentPools_GetQueueStatus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveCollection.cs new file mode 100644 index 000000000000..94436a36887d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveCollection.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryArchiveCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ArchiveCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveCreate.json + // this example is just showing the usage of "Archives_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryArchiveResource + string packageType = "rpm"; + ContainerRegistryArchiveCollection collection = containerRegistry.GetContainerRegistryArchives(packageType); + + // invoke the operation + string archiveName = "myArchiveName"; + ContainerRegistryArchiveData data = new ContainerRegistryArchiveData + { + PackageSource = new ArchivePackageSourceProperties + { + SourceType = ArchivePackageSourceType.Remote, + Uri = new Uri("string"), + }, + PublishedVersion = "string", + RepositoryEndpointPrefix = "string", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, archiveName, data); + ContainerRegistryArchiveResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ArchiveGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveGet.json + // this example is just showing the usage of "Archives_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryArchiveResource + string packageType = "myPackageType"; + ContainerRegistryArchiveCollection collection = containerRegistry.GetContainerRegistryArchives(packageType); + + // invoke the operation + string archiveName = "myArchiveName"; + ContainerRegistryArchiveResource result = await collection.GetAsync(archiveName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ArchiveList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveList.json + // this example is just showing the usage of "Archives_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryArchiveResource + string packageType = "myPackageType"; + ContainerRegistryArchiveCollection collection = containerRegistry.GetContainerRegistryArchives(packageType); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryArchiveResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ArchiveGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveGet.json + // this example is just showing the usage of "Archives_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryArchiveResource + string packageType = "myPackageType"; + ContainerRegistryArchiveCollection collection = containerRegistry.GetContainerRegistryArchives(packageType); + + // invoke the operation + string archiveName = "myArchiveName"; + bool result = await collection.ExistsAsync(archiveName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ArchiveGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveGet.json + // this example is just showing the usage of "Archives_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryArchiveResource + string packageType = "myPackageType"; + ContainerRegistryArchiveCollection collection = containerRegistry.GetContainerRegistryArchives(packageType); + + // invoke the operation + string archiveName = "myArchiveName"; + NullableResponse response = await collection.GetIfExistsAsync(archiveName); + ContainerRegistryArchiveResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveResource.cs new file mode 100644 index 000000000000..e5d85806f963 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveResource.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryArchiveResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ArchiveGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveGet.json + // this example is just showing the usage of "Archives_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "myPackageType"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // invoke the operation + ContainerRegistryArchiveResource result = await containerRegistryArchive.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ArchiveDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveDelete.json + // this example is just showing the usage of "Archives_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "myPackageType"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // invoke the operation + await containerRegistryArchive.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ArchiveUpdate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveUpdate.json + // this example is just showing the usage of "Archives_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "myPackageType"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // invoke the operation + ContainerRegistryArchivePatch patch = new ContainerRegistryArchivePatch + { + PublishedVersion = "string", + }; + ContainerRegistryArchiveResource result = await containerRegistryArchive.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionCollection.cs new file mode 100644 index 000000000000..79f1fb76f443 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionCollection.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryArchiveVersionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ArchiveVersionCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveVersionCreate.json + // this example is just showing the usage of "ArchiveVersions_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // get the collection of this ContainerRegistryArchiveVersionResource + ContainerRegistryArchiveVersionCollection collection = containerRegistryArchive.GetContainerRegistryArchiveVersions(); + + // invoke the operation + string archiveVersionName = "myArchiveVersionName"; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, archiveVersionName); + ContainerRegistryArchiveVersionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ArchiveVersionGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveVersionGet.json + // this example is just showing the usage of "ArchiveVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // get the collection of this ContainerRegistryArchiveVersionResource + ContainerRegistryArchiveVersionCollection collection = containerRegistryArchive.GetContainerRegistryArchiveVersions(); + + // invoke the operation + string archiveVersionName = "myArchiveVersionName"; + ContainerRegistryArchiveVersionResource result = await collection.GetAsync(archiveVersionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ArchiveVersionList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveVersionList.json + // this example is just showing the usage of "ArchiveVersions_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "myPackageType"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // get the collection of this ContainerRegistryArchiveVersionResource + ContainerRegistryArchiveVersionCollection collection = containerRegistryArchive.GetContainerRegistryArchiveVersions(); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryArchiveVersionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ArchiveVersionGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveVersionGet.json + // this example is just showing the usage of "ArchiveVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // get the collection of this ContainerRegistryArchiveVersionResource + ContainerRegistryArchiveVersionCollection collection = containerRegistryArchive.GetContainerRegistryArchiveVersions(); + + // invoke the operation + string archiveVersionName = "myArchiveVersionName"; + bool result = await collection.ExistsAsync(archiveVersionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ArchiveVersionGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveVersionGet.json + // this example is just showing the usage of "ArchiveVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // get the collection of this ContainerRegistryArchiveVersionResource + ContainerRegistryArchiveVersionCollection collection = containerRegistryArchive.GetContainerRegistryArchiveVersions(); + + // invoke the operation + string archiveVersionName = "myArchiveVersionName"; + NullableResponse response = await collection.GetIfExistsAsync(archiveVersionName); + ContainerRegistryArchiveVersionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionResource.cs new file mode 100644 index 000000000000..c7bd1df490c9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionResource.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryArchiveVersionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ArchiveVersionGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveVersionGet.json + // this example is just showing the usage of "ArchiveVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveVersionResource created on azure + // for more information of creating ContainerRegistryArchiveVersionResource, please refer to the document of ContainerRegistryArchiveVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + string archiveVersionName = "myArchiveVersionName"; + ResourceIdentifier containerRegistryArchiveVersionResourceId = ContainerRegistryArchiveVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + ContainerRegistryArchiveVersionResource containerRegistryArchiveVersion = client.GetContainerRegistryArchiveVersionResource(containerRegistryArchiveVersionResourceId); + + // invoke the operation + ContainerRegistryArchiveVersionResource result = await containerRegistryArchiveVersion.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ArchiveVersionDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveVersionDelete.json + // this example is just showing the usage of "ArchiveVersions_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveVersionResource created on azure + // for more information of creating ContainerRegistryArchiveVersionResource, please refer to the document of ContainerRegistryArchiveVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "myPackageType"; + string archiveName = "myArchiveName"; + string archiveVersionName = "myArchiveVersionName"; + ResourceIdentifier containerRegistryArchiveVersionResourceId = ContainerRegistryArchiveVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + ContainerRegistryArchiveVersionResource containerRegistryArchiveVersion = client.GetContainerRegistryArchiveVersionResource(containerRegistryArchiveVersionResourceId); + + // invoke the operation + await containerRegistryArchiveVersion.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ArchiveVersionCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ArchiveVersionCreate.json + // this example is just showing the usage of "ArchiveVersions_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveVersionResource created on azure + // for more information of creating ContainerRegistryArchiveVersionResource, please refer to the document of ContainerRegistryArchiveVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + string archiveVersionName = "myArchiveVersionName"; + ResourceIdentifier containerRegistryArchiveVersionResourceId = ContainerRegistryArchiveVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + ContainerRegistryArchiveVersionResource containerRegistryArchiveVersion = client.GetContainerRegistryArchiveVersionResource(containerRegistryArchiveVersionResourceId); + + // invoke the operation + ArmOperation lro = await containerRegistryArchiveVersion.UpdateAsync(WaitUntil.Completed); + ContainerRegistryArchiveVersionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleCollection.cs index e9e064a461f5..d00373144ed4 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerRegistryCacheRuleCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CacheRuleCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CacheRuleCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CacheRuleCreate.json // this example is just showing the usage of "CacheRules_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CacheRuleCreate() [Ignore("Only validating compilation of examples")] public async Task Get_CacheRuleGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CacheRuleGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CacheRuleGet.json // this example is just showing the usage of "CacheRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CacheRuleGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CacheRuleList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CacheRuleList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CacheRuleList.json // this example is just showing the usage of "CacheRules_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task GetAll_CacheRuleList() [Ignore("Only validating compilation of examples")] public async Task Exists_CacheRuleGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CacheRuleGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CacheRuleGet.json // this example is just showing the usage of "CacheRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_CacheRuleGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CacheRuleGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CacheRuleGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CacheRuleGet.json // this example is just showing the usage of "CacheRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleResource.cs index a6831a1cc2bc..b494fc8dc8ee 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryCacheRuleResource [Ignore("Only validating compilation of examples")] public async Task Get_CacheRuleGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CacheRuleGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CacheRuleGet.json // this example is just showing the usage of "CacheRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CacheRuleGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CacheRuleDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CacheRuleDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CacheRuleDelete.json // this example is just showing the usage of "CacheRules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CacheRuleDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CacheRuleUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CacheRuleUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CacheRuleUpdate.json // this example is just showing the usage of "CacheRules_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCollection.cs index ce02908cbf4a..fbf07c18a9ac 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ContainerRegistryCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RegistryCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryCreate.json // this example is just showing the usage of "Registries_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,11 +59,95 @@ public async Task CreateOrUpdate_RegistryCreate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_RegistryCreateAbac() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryCreateAbac.json + // this example is just showing the usage of "Registries_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerRegistryResource + ContainerRegistryCollection collection = resourceGroupResource.GetContainerRegistries(); + + // invoke the operation + string registryName = "myRegistry"; + ContainerRegistryData data = new ContainerRegistryData(new AzureLocation("westus"), new ContainerRegistrySku(ContainerRegistrySkuName.Standard)) + { + RoleAssignmentMode = ContainerRegistryRoleAssignmentMode.AbacRepositoryPermissions, + Tags = +{ +["key"] = "value" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, registryName, data); + ContainerRegistryResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_RegistryCreateDomainNameLabelScope() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryCreateDomainNameLabelScope.json + // this example is just showing the usage of "Registries_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerRegistryResource + ContainerRegistryCollection collection = resourceGroupResource.GetContainerRegistries(); + + // invoke the operation + string registryName = "myRegistry"; + ContainerRegistryData data = new ContainerRegistryData(new AzureLocation("westus"), new ContainerRegistrySku(ContainerRegistrySkuName.Standard)) + { + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse, + Tags = +{ +["key"] = "value" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, registryName, data); + ContainerRegistryResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RegistryCreateZoneRedundant() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryCreateZoneRedundant.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryCreateZoneRedundant.json // this example is just showing the usage of "Registries_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -105,7 +189,7 @@ public async Task CreateOrUpdate_RegistryCreateZoneRedundant() [Ignore("Only validating compilation of examples")] public async Task Get_RegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryGet.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +222,7 @@ public async Task Get_RegistryGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_RegistryListByResourceGroup() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryListByResourceGroup.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryListByResourceGroup.json // this example is just showing the usage of "Registries_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +257,7 @@ public async Task GetAll_RegistryListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_RegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryGet.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -202,7 +286,7 @@ public async Task Exists_RegistryGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryGet.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetCollection.cs index 1ae1de6aa41a..fc1c3fba17ad 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ContainerRegistryCredentialSetCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CredentialSetCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CredentialSetCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CredentialSetCreate.json // this example is just showing the usage of "CredentialSets_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -67,7 +67,7 @@ public async Task CreateOrUpdate_CredentialSetCreate() [Ignore("Only validating compilation of examples")] public async Task Get_CredentialSetGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CredentialSetGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CredentialSetGet.json // this example is just showing the usage of "CredentialSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,7 +101,7 @@ public async Task Get_CredentialSetGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CredentialSetList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CredentialSetList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CredentialSetList.json // this example is just showing the usage of "CredentialSets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +137,7 @@ public async Task GetAll_CredentialSetList() [Ignore("Only validating compilation of examples")] public async Task Exists_CredentialSetGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CredentialSetGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CredentialSetGet.json // this example is just showing the usage of "CredentialSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task Exists_CredentialSetGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CredentialSetGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CredentialSetGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CredentialSetGet.json // this example is just showing the usage of "CredentialSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetResource.cs index 86ab0f3a2022..60592fad779d 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryCredentialSetResource [Ignore("Only validating compilation of examples")] public async Task Get_CredentialSetGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CredentialSetGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CredentialSetGet.json // this example is just showing the usage of "CredentialSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CredentialSetGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CredentialSetDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CredentialSetDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CredentialSetDelete.json // this example is just showing the usage of "CredentialSets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CredentialSetDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CredentialSetUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/CredentialSetUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/CredentialSetUpdate.json // this example is just showing the usage of "CredentialSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineCollection.cs new file mode 100644 index 000000000000..76532ba44bd0 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineCollection.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryExportPipelineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ExportPipelineCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ExportPipelineCreate.json + // this example is just showing the usage of "ExportPipelines_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryExportPipelineResource + ContainerRegistryExportPipelineCollection collection = containerRegistry.GetContainerRegistryExportPipelines(); + + // invoke the operation + string exportPipelineName = "myExportPipeline"; + ContainerRegistryExportPipelineData data = new ContainerRegistryExportPipelineData + { + Location = new AzureLocation("westus"), + Identity = new ManagedServiceIdentity("SystemAssigned"), + Target = new ExportPipelineTargetProperties + { + PipelineTargetType = "AzureStorageBlobContainer", + Uri = new Uri("https://accountname.blob.core.windows.net/containername"), + KeyVaultUri = new Uri("https://myvault.vault.azure.net/secrets/acrexportsas"), + StorageAccessMode = StorageAccessMode.SasToken, + }, + Options = { ContainerRegistryPipelineOption.OverwriteBlobs }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, exportPipelineName, data); + ContainerRegistryExportPipelineResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ExportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ExportPipelineGet.json + // this example is just showing the usage of "ExportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryExportPipelineResource + ContainerRegistryExportPipelineCollection collection = containerRegistry.GetContainerRegistryExportPipelines(); + + // invoke the operation + string exportPipelineName = "myExportPipeline"; + ContainerRegistryExportPipelineResource result = await collection.GetAsync(exportPipelineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ExportPipelineList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ExportPipelineList.json + // this example is just showing the usage of "ExportPipelines_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryExportPipelineResource + ContainerRegistryExportPipelineCollection collection = containerRegistry.GetContainerRegistryExportPipelines(); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryExportPipelineResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ExportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ExportPipelineGet.json + // this example is just showing the usage of "ExportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryExportPipelineResource + ContainerRegistryExportPipelineCollection collection = containerRegistry.GetContainerRegistryExportPipelines(); + + // invoke the operation + string exportPipelineName = "myExportPipeline"; + bool result = await collection.ExistsAsync(exportPipelineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ExportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ExportPipelineGet.json + // this example is just showing the usage of "ExportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryExportPipelineResource + ContainerRegistryExportPipelineCollection collection = containerRegistry.GetContainerRegistryExportPipelines(); + + // invoke the operation + string exportPipelineName = "myExportPipeline"; + NullableResponse response = await collection.GetIfExistsAsync(exportPipelineName); + ContainerRegistryExportPipelineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineResource.cs new file mode 100644 index 000000000000..431834dee615 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineResource.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryExportPipelineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ExportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ExportPipelineGet.json + // this example is just showing the usage of "ExportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryExportPipelineResource created on azure + // for more information of creating ContainerRegistryExportPipelineResource, please refer to the document of ContainerRegistryExportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string exportPipelineName = "myExportPipeline"; + ResourceIdentifier containerRegistryExportPipelineResourceId = ContainerRegistryExportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, exportPipelineName); + ContainerRegistryExportPipelineResource containerRegistryExportPipeline = client.GetContainerRegistryExportPipelineResource(containerRegistryExportPipelineResourceId); + + // invoke the operation + ContainerRegistryExportPipelineResource result = await containerRegistryExportPipeline.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ExportPipelineDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ExportPipelineDelete.json + // this example is just showing the usage of "ExportPipelines_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryExportPipelineResource created on azure + // for more information of creating ContainerRegistryExportPipelineResource, please refer to the document of ContainerRegistryExportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string exportPipelineName = "myExportPipeline"; + ResourceIdentifier containerRegistryExportPipelineResourceId = ContainerRegistryExportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, exportPipelineName); + ContainerRegistryExportPipelineResource containerRegistryExportPipeline = client.GetContainerRegistryExportPipelineResource(containerRegistryExportPipelineResourceId); + + // invoke the operation + await containerRegistryExportPipeline.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ExportPipelineCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ExportPipelineCreate.json + // this example is just showing the usage of "ExportPipelines_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryExportPipelineResource created on azure + // for more information of creating ContainerRegistryExportPipelineResource, please refer to the document of ContainerRegistryExportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string exportPipelineName = "myExportPipeline"; + ResourceIdentifier containerRegistryExportPipelineResourceId = ContainerRegistryExportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, exportPipelineName); + ContainerRegistryExportPipelineResource containerRegistryExportPipeline = client.GetContainerRegistryExportPipelineResource(containerRegistryExportPipelineResourceId); + + // invoke the operation + ContainerRegistryExportPipelineData data = new ContainerRegistryExportPipelineData + { + Location = new AzureLocation("westus"), + Identity = new ManagedServiceIdentity("SystemAssigned"), + Target = new ExportPipelineTargetProperties + { + PipelineTargetType = "AzureStorageBlobContainer", + Uri = new Uri("https://accountname.blob.core.windows.net/containername"), + KeyVaultUri = new Uri("https://myvault.vault.azure.net/secrets/acrexportsas"), + StorageAccessMode = StorageAccessMode.SasToken, + }, + Options = { ContainerRegistryPipelineOption.OverwriteBlobs }, + }; + ArmOperation lro = await containerRegistryExportPipeline.UpdateAsync(WaitUntil.Completed, data); + ContainerRegistryExportPipelineResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineCollection.cs new file mode 100644 index 000000000000..d5631e9ba74a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineCollection.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryImportPipelineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ImportPipelineCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportPipelineCreate.json + // this example is just showing the usage of "ImportPipelines_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryImportPipelineResource + ContainerRegistryImportPipelineCollection collection = containerRegistry.GetContainerRegistryImportPipelines(); + + // invoke the operation + string importPipelineName = "myImportPipeline"; + ContainerRegistryImportPipelineData data = new ContainerRegistryImportPipelineData + { + Location = new AzureLocation("westus"), + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2")] = new UserAssignedIdentity() +}, + }, + Source = new ImportPipelineSourceProperties + { + ContainerRegistryPipelineSourceType = ContainerRegistryPipelineSourceType.AzureStorageBlobContainer, + Uri = new Uri("https://accountname.blob.core.windows.net/containername"), + KeyVaultUri = new Uri("https://myvault.vault.azure.net/secrets/acrimportsas"), + StorageAccessMode = StorageAccessMode.SasToken, + }, + Options = { ContainerRegistryPipelineOption.OverwriteTags, ContainerRegistryPipelineOption.DeleteSourceBlobOnSuccess, ContainerRegistryPipelineOption.ContinueOnErrors }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, importPipelineName, data); + ContainerRegistryImportPipelineResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ImportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportPipelineGet.json + // this example is just showing the usage of "ImportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryImportPipelineResource + ContainerRegistryImportPipelineCollection collection = containerRegistry.GetContainerRegistryImportPipelines(); + + // invoke the operation + string importPipelineName = "myImportPipeline"; + ContainerRegistryImportPipelineResource result = await collection.GetAsync(importPipelineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ImportPipelineList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportPipelineList.json + // this example is just showing the usage of "ImportPipelines_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryImportPipelineResource + ContainerRegistryImportPipelineCollection collection = containerRegistry.GetContainerRegistryImportPipelines(); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryImportPipelineResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ImportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportPipelineGet.json + // this example is just showing the usage of "ImportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryImportPipelineResource + ContainerRegistryImportPipelineCollection collection = containerRegistry.GetContainerRegistryImportPipelines(); + + // invoke the operation + string importPipelineName = "myImportPipeline"; + bool result = await collection.ExistsAsync(importPipelineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ImportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportPipelineGet.json + // this example is just showing the usage of "ImportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryImportPipelineResource + ContainerRegistryImportPipelineCollection collection = containerRegistry.GetContainerRegistryImportPipelines(); + + // invoke the operation + string importPipelineName = "myImportPipeline"; + NullableResponse response = await collection.GetIfExistsAsync(importPipelineName); + ContainerRegistryImportPipelineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineResource.cs new file mode 100644 index 000000000000..2fb028045bac --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineResource.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryImportPipelineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ImportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportPipelineGet.json + // this example is just showing the usage of "ImportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryImportPipelineResource created on azure + // for more information of creating ContainerRegistryImportPipelineResource, please refer to the document of ContainerRegistryImportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string importPipelineName = "myImportPipeline"; + ResourceIdentifier containerRegistryImportPipelineResourceId = ContainerRegistryImportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, importPipelineName); + ContainerRegistryImportPipelineResource containerRegistryImportPipeline = client.GetContainerRegistryImportPipelineResource(containerRegistryImportPipelineResourceId); + + // invoke the operation + ContainerRegistryImportPipelineResource result = await containerRegistryImportPipeline.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ImportPipelineDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportPipelineDelete.json + // this example is just showing the usage of "ImportPipelines_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryImportPipelineResource created on azure + // for more information of creating ContainerRegistryImportPipelineResource, please refer to the document of ContainerRegistryImportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string importPipelineName = "myImportPipeline"; + ResourceIdentifier containerRegistryImportPipelineResourceId = ContainerRegistryImportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, importPipelineName); + ContainerRegistryImportPipelineResource containerRegistryImportPipeline = client.GetContainerRegistryImportPipelineResource(containerRegistryImportPipelineResourceId); + + // invoke the operation + await containerRegistryImportPipeline.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ImportPipelineCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportPipelineCreate.json + // this example is just showing the usage of "ImportPipelines_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryImportPipelineResource created on azure + // for more information of creating ContainerRegistryImportPipelineResource, please refer to the document of ContainerRegistryImportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string importPipelineName = "myImportPipeline"; + ResourceIdentifier containerRegistryImportPipelineResourceId = ContainerRegistryImportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, importPipelineName); + ContainerRegistryImportPipelineResource containerRegistryImportPipeline = client.GetContainerRegistryImportPipelineResource(containerRegistryImportPipelineResourceId); + + // invoke the operation + ContainerRegistryImportPipelineData data = new ContainerRegistryImportPipelineData + { + Location = new AzureLocation("westus"), + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2")] = new UserAssignedIdentity() +}, + }, + Source = new ImportPipelineSourceProperties + { + ContainerRegistryPipelineSourceType = ContainerRegistryPipelineSourceType.AzureStorageBlobContainer, + Uri = new Uri("https://accountname.blob.core.windows.net/containername"), + KeyVaultUri = new Uri("https://myvault.vault.azure.net/secrets/acrimportsas"), + StorageAccessMode = StorageAccessMode.SasToken, + }, + Options = { ContainerRegistryPipelineOption.OverwriteTags, ContainerRegistryPipelineOption.DeleteSourceBlobOnSuccess, ContainerRegistryPipelineOption.ContinueOnErrors }, + }; + ArmOperation lro = await containerRegistryImportPipeline.UpdateAsync(WaitUntil.Completed, data); + ContainerRegistryImportPipelineResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunCollection.cs new file mode 100644 index 000000000000..e27de7ff5f6a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunCollection.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryPipelineRunCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PipelineRunCreateExport() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PipelineRunCreate_Export.json + // this example is just showing the usage of "PipelineRuns_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation + string pipelineRunName = "myPipelineRun"; + ContainerRegistryPipelineRunData data = new ContainerRegistryPipelineRunData + { + Request = new ConnectedRegistryPipelineRunContent + { + PipelineResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + Artifacts = { "sourceRepository/hello-world", "sourceRepository2@sha256:00000000000000000000000000000000000" }, + Target = new ContainerRegistryPipelineRunTargetProperties + { + TargetType = ContainerRegistryPipelineRunTargetType.AzureStorageBlob, + Name = "myblob.tar.gz", + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineRunName, data); + ContainerRegistryPipelineRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PipelineRunCreateImport() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PipelineRunCreate_Import.json + // this example is just showing the usage of "PipelineRuns_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation + string pipelineRunName = "myPipelineRun"; + ContainerRegistryPipelineRunData data = new ContainerRegistryPipelineRunData + { + Request = new ConnectedRegistryPipelineRunContent + { + PipelineResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline"), + Source = new ContainerRegistryPipelineRunSourceProperties + { + SourceType = ContainerRegistryPipelineRunSourceType.AzureStorageBlob, + Name = "myblob.tar.gz", + }, + CatalogDigest = "sha256@", + }, + ForceUpdateTag = "2020-03-04T17:23:21.9261521+00:00", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineRunName, data); + ContainerRegistryPipelineRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PipelineRunGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PipelineRunGet.json + // this example is just showing the usage of "PipelineRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation + string pipelineRunName = "myPipelineRun"; + ContainerRegistryPipelineRunResource result = await collection.GetAsync(pipelineRunName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_PipelineRunList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PipelineRunList.json + // this example is just showing the usage of "PipelineRuns_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryPipelineRunResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_PipelineRunGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PipelineRunGet.json + // this example is just showing the usage of "PipelineRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation + string pipelineRunName = "myPipelineRun"; + bool result = await collection.ExistsAsync(pipelineRunName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_PipelineRunGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PipelineRunGet.json + // this example is just showing the usage of "PipelineRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation + string pipelineRunName = "myPipelineRun"; + NullableResponse response = await collection.GetIfExistsAsync(pipelineRunName); + ContainerRegistryPipelineRunResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunResource.cs new file mode 100644 index 000000000000..21bf7305d96a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunResource.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryPipelineRunResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PipelineRunGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PipelineRunGet.json + // this example is just showing the usage of "PipelineRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryPipelineRunResource created on azure + // for more information of creating ContainerRegistryPipelineRunResource, please refer to the document of ContainerRegistryPipelineRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string pipelineRunName = "myPipelineRun"; + ResourceIdentifier containerRegistryPipelineRunResourceId = ContainerRegistryPipelineRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, pipelineRunName); + ContainerRegistryPipelineRunResource containerRegistryPipelineRun = client.GetContainerRegistryPipelineRunResource(containerRegistryPipelineRunResourceId); + + // invoke the operation + ContainerRegistryPipelineRunResource result = await containerRegistryPipelineRun.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_PipelineRunDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PipelineRunDelete.json + // this example is just showing the usage of "PipelineRuns_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryPipelineRunResource created on azure + // for more information of creating ContainerRegistryPipelineRunResource, please refer to the document of ContainerRegistryPipelineRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string pipelineRunName = "myPipelineRun"; + ResourceIdentifier containerRegistryPipelineRunResourceId = ContainerRegistryPipelineRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, pipelineRunName); + ContainerRegistryPipelineRunResource containerRegistryPipelineRun = client.GetContainerRegistryPipelineRunResource(containerRegistryPipelineRunResourceId); + + // invoke the operation + await containerRegistryPipelineRun.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PipelineRunCreateExport() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PipelineRunCreate_Export.json + // this example is just showing the usage of "PipelineRuns_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryPipelineRunResource created on azure + // for more information of creating ContainerRegistryPipelineRunResource, please refer to the document of ContainerRegistryPipelineRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string pipelineRunName = "myPipelineRun"; + ResourceIdentifier containerRegistryPipelineRunResourceId = ContainerRegistryPipelineRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, pipelineRunName); + ContainerRegistryPipelineRunResource containerRegistryPipelineRun = client.GetContainerRegistryPipelineRunResource(containerRegistryPipelineRunResourceId); + + // invoke the operation + ContainerRegistryPipelineRunData data = new ContainerRegistryPipelineRunData + { + Request = new ConnectedRegistryPipelineRunContent + { + PipelineResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + Artifacts = { "sourceRepository/hello-world", "sourceRepository2@sha256:00000000000000000000000000000000000" }, + Target = new ContainerRegistryPipelineRunTargetProperties + { + TargetType = ContainerRegistryPipelineRunTargetType.AzureStorageBlob, + Name = "myblob.tar.gz", + }, + }, + }; + ArmOperation lro = await containerRegistryPipelineRun.UpdateAsync(WaitUntil.Completed, data); + ContainerRegistryPipelineRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PipelineRunCreateImport() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PipelineRunCreate_Import.json + // this example is just showing the usage of "PipelineRuns_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryPipelineRunResource created on azure + // for more information of creating ContainerRegistryPipelineRunResource, please refer to the document of ContainerRegistryPipelineRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string pipelineRunName = "myPipelineRun"; + ResourceIdentifier containerRegistryPipelineRunResourceId = ContainerRegistryPipelineRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, pipelineRunName); + ContainerRegistryPipelineRunResource containerRegistryPipelineRun = client.GetContainerRegistryPipelineRunResource(containerRegistryPipelineRunResourceId); + + // invoke the operation + ContainerRegistryPipelineRunData data = new ContainerRegistryPipelineRunData + { + Request = new ConnectedRegistryPipelineRunContent + { + PipelineResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline"), + Source = new ContainerRegistryPipelineRunSourceProperties + { + SourceType = ContainerRegistryPipelineRunSourceType.AzureStorageBlob, + Name = "myblob.tar.gz", + }, + CatalogDigest = "sha256@", + }, + ForceUpdateTag = "2020-03-04T17:23:21.9261521+00:00", + }; + ArmOperation lro = await containerRegistryPipelineRun.UpdateAsync(WaitUntil.Completed, data); + ContainerRegistryPipelineRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionCollection.cs index a633bde35f15..ffbdbda6ebab 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PrivateEndpointConnectionCreateOrUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/PrivateEndpointConnectionCreateOrUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_PrivateEndpointConnectionCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_PrivateEndpointConnectionList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/PrivateEndpointConnectionList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PrivateEndpointConnectionList.json // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_PrivateEndpointConnectionList() [Ignore("Only validating compilation of examples")] public async Task Exists_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Exists_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionResource.cs index de65b4e120d2..4b55da67caf7 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_PrivateEndpointConnectionDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/PrivateEndpointConnectionDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PrivateEndpointConnectionDelete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_PrivateEndpointConnectionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_PrivateEndpointConnectionCreateOrUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/PrivateEndpointConnectionCreateOrUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResource.cs index c906bc8b96d2..f18ea2620c77 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerRegistryPrivateLinkResource [Ignore("Only validating compilation of examples")] public async Task Get_RegistryGetPrivateLinkResource() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryGetPrivateLinkResource.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryGetPrivateLinkResource.json // this example is just showing the usage of "Registries_GetPrivateLinkResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResourceCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResourceCollection.cs index a74a5378fb89..08d150d687f0 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResourceCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerRegistryPrivateLinkResourceCollection [Ignore("Only validating compilation of examples")] public async Task Get_RegistryGetPrivateLinkResource() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryGetPrivateLinkResource.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryGetPrivateLinkResource.json // this example is just showing the usage of "Registries_GetPrivateLinkResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_RegistryGetPrivateLinkResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_RegistryListPrivateLinkResources() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryListPrivateLinkResources.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryListPrivateLinkResources.json // this example is just showing the usage of "Registries_ListPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_RegistryListPrivateLinkResources() [Ignore("Only validating compilation of examples")] public async Task Exists_RegistryGetPrivateLinkResource() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryGetPrivateLinkResource.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryGetPrivateLinkResource.json // this example is just showing the usage of "Registries_GetPrivateLinkResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_RegistryGetPrivateLinkResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RegistryGetPrivateLinkResource() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryGetPrivateLinkResource.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryGetPrivateLinkResource.json // this example is just showing the usage of "Registries_GetPrivateLinkResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationCollection.cs index 5da404b83029..d0d4dc587a99 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryReplicationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ReplicationCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ReplicationCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ReplicationCreate.json // this example is just showing the usage of "Replications_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task CreateOrUpdate_ReplicationCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ReplicationCreateZoneRedundant() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ReplicationCreateZoneRedundant.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ReplicationCreateZoneRedundant.json // this example is just showing the usage of "Replications_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task CreateOrUpdate_ReplicationCreateZoneRedundant() [Ignore("Only validating compilation of examples")] public async Task Get_ReplicationGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ReplicationGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ReplicationGet.json // this example is just showing the usage of "Replications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +140,7 @@ public async Task Get_ReplicationGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ReplicationList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ReplicationList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ReplicationList.json // this example is just showing the usage of "Replications_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -176,7 +176,7 @@ public async Task GetAll_ReplicationList() [Ignore("Only validating compilation of examples")] public async Task Exists_ReplicationGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ReplicationGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ReplicationGet.json // this example is just showing the usage of "Replications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -206,7 +206,7 @@ public async Task Exists_ReplicationGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ReplicationGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ReplicationGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ReplicationGet.json // this example is just showing the usage of "Replications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationResource.cs index 9a01b6745dbd..5e38ee8d3e53 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryReplicationResource [Ignore("Only validating compilation of examples")] public async Task Get_ReplicationGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ReplicationGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ReplicationGet.json // this example is just showing the usage of "Replications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_ReplicationGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ReplicationDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ReplicationDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ReplicationDelete.json // this example is just showing the usage of "Replications_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_ReplicationDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ReplicationUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ReplicationUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ReplicationUpdate.json // this example is just showing the usage of "Replications_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryResource.cs index 098d0c266f70..8872058daaf6 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryResource [Ignore("Only validating compilation of examples")] public async Task Get_RegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryGet.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_RegistryGet() [Ignore("Only validating compilation of examples")] public async Task Delete_RegistryDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryDelete.json // this example is just showing the usage of "Registries_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_RegistryDelete() [Ignore("Only validating compilation of examples")] public async Task Update_RegistryUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryUpdate.json // this example is just showing the usage of "Registries_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,6 +101,7 @@ public async Task Update_RegistryUpdate() }, Sku = new ContainerRegistrySku(ContainerRegistrySkuName.Standard), IsAdminUserEnabled = true, + RoleAssignmentMode = ContainerRegistryRoleAssignmentMode.AbacRepositoryPermissions, }; ArmOperation lro = await containerRegistry.UpdateAsync(WaitUntil.Completed, patch); ContainerRegistryResource result = lro.Value; @@ -116,7 +117,7 @@ public async Task Update_RegistryUpdate() [Ignore("Only validating compilation of examples")] public async Task ImportImage_ImportImageByManifestDigest() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ImportImageByManifestDigest.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportImageByManifestDigest.json // this example is just showing the usage of "Registries_ImportImage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -151,7 +152,7 @@ public async Task ImportImage_ImportImageByManifestDigest() [Ignore("Only validating compilation of examples")] public async Task ImportImage_ImportImageByTag() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ImportImageByTag.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportImageByTag.json // this example is just showing the usage of "Registries_ImportImage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -186,7 +187,7 @@ public async Task ImportImage_ImportImageByTag() [Ignore("Only validating compilation of examples")] public async Task ImportImage_ImportImageFromPublicRegistry() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ImportImageFromPublicRegistry.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ImportImageFromPublicRegistry.json // this example is just showing the usage of "Registries_ImportImage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -221,7 +222,7 @@ public async Task ImportImage_ImportImageFromPublicRegistry() [Ignore("Only validating compilation of examples")] public async Task GetUsages_RegistryListUsages() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryListUsages.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryListUsages.json // this example is just showing the usage of "Registries_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -250,7 +251,7 @@ public async Task GetUsages_RegistryListUsages() [Ignore("Only validating compilation of examples")] public async Task GetCredentials_RegistryListCredentials() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryListCredentials.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryListCredentials.json // this example is just showing the usage of "Registries_ListCredentials" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -276,7 +277,7 @@ public async Task GetCredentials_RegistryListCredentials() [Ignore("Only validating compilation of examples")] public async Task RegenerateCredential_RegistryRegenerateCredential() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryRegenerateCredential.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryRegenerateCredential.json // this example is just showing the usage of "Registries_RegenerateCredential" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -303,7 +304,7 @@ public async Task RegenerateCredential_RegistryRegenerateCredential() [Ignore("Only validating compilation of examples")] public async Task GenerateCredentials_RegistryGenerateCredentials() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryGenerateCredentials.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryGenerateCredentials.json // this example is just showing the usage of "Registries_GenerateCredentials" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -335,7 +336,7 @@ public async Task GenerateCredentials_RegistryGenerateCredentials() [Ignore("Only validating compilation of examples")] public async Task ScheduleRun_RegistriesScheduleRun() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistriesScheduleRun.json // this example is just showing the usage of "Schedules_ScheduleRun" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -371,8 +372,7 @@ public async Task ScheduleRun_RegistriesScheduleRun() SourceLocation = "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D", IsArchiveEnabled = true, }; - ArmOperation lro = await containerRegistry.ScheduleRunAsync(WaitUntil.Completed, content); - ContainerRegistryRunResource result = lro.Value; + ContainerRegistryRunResource result = await containerRegistry.ScheduleRunAsync(content); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -385,7 +385,7 @@ public async Task ScheduleRun_RegistriesScheduleRun() [Ignore("Only validating compilation of examples")] public async Task ScheduleRun_RegistriesScheduleRunEncodedTaskRun() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json // this example is just showing the usage of "Schedules_ScheduleRun" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -414,8 +414,7 @@ public async Task ScheduleRun_RegistriesScheduleRunEncodedTaskRun() }}, AgentCpu = 2, }; - ArmOperation lro = await containerRegistry.ScheduleRunAsync(WaitUntil.Completed, content); - ContainerRegistryRunResource result = lro.Value; + ContainerRegistryRunResource result = await containerRegistry.ScheduleRunAsync(content); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -428,7 +427,7 @@ public async Task ScheduleRun_RegistriesScheduleRunEncodedTaskRun() [Ignore("Only validating compilation of examples")] public async Task ScheduleRun_RegistriesScheduleRunFileTaskRun() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json // this example is just showing the usage of "Schedules_ScheduleRun" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -458,8 +457,7 @@ public async Task ScheduleRun_RegistriesScheduleRunFileTaskRun() AgentCpu = 2, SourceLocation = "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D", }; - ArmOperation lro = await containerRegistry.ScheduleRunAsync(WaitUntil.Completed, content); - ContainerRegistryRunResource result = lro.Value; + ContainerRegistryRunResource result = await containerRegistry.ScheduleRunAsync(content); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -472,7 +470,7 @@ public async Task ScheduleRun_RegistriesScheduleRunFileTaskRun() [Ignore("Only validating compilation of examples")] public async Task ScheduleRun_RegistriesScheduleRunTask() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_Task.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistriesScheduleRun_Task.json // this example is just showing the usage of "Schedules_ScheduleRun" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -512,8 +510,7 @@ public async Task ScheduleRun_RegistriesScheduleRunTask() UpdateTriggerToken = "aGVsbG8gd29ybGQ=", }, }; - ArmOperation lro = await containerRegistry.ScheduleRunAsync(WaitUntil.Completed, content); - ContainerRegistryRunResource result = lro.Value; + ContainerRegistryRunResource result = await containerRegistry.ScheduleRunAsync(content); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -526,7 +523,7 @@ public async Task ScheduleRun_RegistriesScheduleRunTask() [Ignore("Only validating compilation of examples")] public async Task ScheduleRun_RegistriesScheduleRunTaskWithCustomCredentials() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json // this example is just showing the usage of "Schedules_ScheduleRun" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -554,7 +551,10 @@ public async Task ScheduleRun_RegistriesScheduleRunTaskWithCustomCredentials() }}, Credentials = new ContainerRegistryCredentials { - SourceRegistryLoginMode = SourceRegistryLoginMode.Default, + SourceRegistry = new SourceRegistryCredentials + { + LoginMode = SourceRegistryLoginMode.Default, + }, CustomRegistries = { ["myregistry.azurecr.io"] = new CustomRegistryCredentials @@ -573,8 +573,7 @@ public async Task ScheduleRun_RegistriesScheduleRunTaskWithCustomCredentials() }, }, }; - ArmOperation lro = await containerRegistry.ScheduleRunAsync(WaitUntil.Completed, content); - ContainerRegistryRunResource result = lro.Value; + ContainerRegistryRunResource result = await containerRegistry.ScheduleRunAsync(content); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -587,7 +586,7 @@ public async Task ScheduleRun_RegistriesScheduleRunTaskWithCustomCredentials() [Ignore("Only validating compilation of examples")] public async Task ScheduleRun_RegistriesScheduleRunWithCustomCredentials() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json // this example is just showing the usage of "Schedules_ScheduleRun" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -624,7 +623,10 @@ public async Task ScheduleRun_RegistriesScheduleRunWithCustomCredentials() SourceLocation = "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D", Credentials = new ContainerRegistryCredentials { - SourceRegistryLoginMode = SourceRegistryLoginMode.Default, + SourceRegistry = new SourceRegistryCredentials + { + LoginMode = SourceRegistryLoginMode.Default, + }, CustomRegistries = { ["myregistry.azurecr.io"] = new CustomRegistryCredentials @@ -657,8 +659,7 @@ public async Task ScheduleRun_RegistriesScheduleRunWithCustomCredentials() }, IsArchiveEnabled = true, }; - ArmOperation lro = await containerRegistry.ScheduleRunAsync(WaitUntil.Completed, content); - ContainerRegistryRunResource result = lro.Value; + ContainerRegistryRunResource result = await containerRegistry.ScheduleRunAsync(content); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -671,7 +672,7 @@ public async Task ScheduleRun_RegistriesScheduleRunWithCustomCredentials() [Ignore("Only validating compilation of examples")] public async Task ScheduleRun_RegistriesScheduleRunWithLogTemplate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json // this example is just showing the usage of "Schedules_ScheduleRun" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -708,8 +709,7 @@ public async Task ScheduleRun_RegistriesScheduleRunWithLogTemplate() IsArchiveEnabled = true, LogTemplate = "acr/tasks:{{.Run.OS}}", }; - ArmOperation lro = await containerRegistry.ScheduleRunAsync(WaitUntil.Completed, content); - ContainerRegistryRunResource result = lro.Value; + ContainerRegistryRunResource result = await containerRegistry.ScheduleRunAsync(content); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -722,7 +722,7 @@ public async Task ScheduleRun_RegistriesScheduleRunWithLogTemplate() [Ignore("Only validating compilation of examples")] public async Task GetBuildSourceUploadUrl_RegistriesGetBuildSourceUploadUrl() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json // this example is just showing the usage of "Builds_GetBuildSourceUploadUrl" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryRunCollection.cs index e356684afd7d..4860c92814d1 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryRunCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryRunCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerRegistryRunCollection [Ignore("Only validating compilation of examples")] public async Task Get_RunsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RunsGet.json // this example is just showing the usage of "Runs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_RunsGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_RunsList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RunsList.json // this example is just showing the usage of "Runs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task GetAll_RunsList() [Ignore("Only validating compilation of examples")] public async Task Exists_RunsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RunsGet.json // this example is just showing the usage of "Runs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -121,7 +121,7 @@ public async Task Exists_RunsGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RunsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RunsGet.json // this example is just showing the usage of "Runs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryRunResource.cs index a17617db5d2b..fc611ea9064a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryRunResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryRunResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryRunResource [Ignore("Only validating compilation of examples")] public async Task Get_RunsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RunsGet.json // this example is just showing the usage of "Runs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_RunsGet() [Ignore("Only validating compilation of examples")] public async Task Update_RunsUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RunsUpdate.json // this example is just showing the usage of "Runs_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -73,8 +73,7 @@ public async Task Update_RunsUpdate() { IsArchiveEnabled = true, }; - ArmOperation lro = await containerRegistryRun.UpdateAsync(WaitUntil.Completed, patch); - ContainerRegistryRunResource result = lro.Value; + ContainerRegistryRunResource result = await containerRegistryRun.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -87,7 +86,7 @@ public async Task Update_RunsUpdate() [Ignore("Only validating compilation of examples")] public async Task GetLogSasUrl_RunsGetLogSasUrl() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGetLogSasUrl.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RunsGetLogSasUrl.json // this example is just showing the usage of "Runs_GetLogSasUrl" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +113,7 @@ public async Task GetLogSasUrl_RunsGetLogSasUrl() [Ignore("Only validating compilation of examples")] public async Task Cancel_RunsCancel() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsCancel.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RunsCancel.json // this example is just showing the usage of "Runs_Cancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +131,7 @@ public async Task Cancel_RunsCancel() ContainerRegistryRunResource containerRegistryRun = client.GetContainerRegistryRunResource(containerRegistryRunResourceId); // invoke the operation - await containerRegistryRun.CancelAsync(WaitUntil.Completed); + await containerRegistryRun.CancelAsync(); Console.WriteLine("Succeeded"); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskCollection.cs index 66b716680736..e8804a0e45fc 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ContainerRegistryTaskCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_TasksCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksCreate.json // this example is just showing the usage of "Tasks_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task CreateOrUpdate_TasksCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_TasksCreateQuickTask() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate_QuickTask.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksCreate_QuickTask.json // this example is just showing the usage of "Tasks_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,11 +142,93 @@ public async Task CreateOrUpdate_TasksCreateQuickTask() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_TasksCreateWithLoginIdentity() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ManagedIdentity/TasksCreate_WithLoginIdentity.json + // this example is just showing the usage of "Tasks_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryTaskResource + ContainerRegistryTaskCollection collection = containerRegistry.GetContainerRegistryTasks(); + + // invoke the operation + string taskName = "mytTask"; + ContainerRegistryTaskData data = new ContainerRegistryTaskData(new AzureLocation("eastus")) + { + Identity = new ManagedServiceIdentity("SystemAssigned"), + Status = ContainerRegistryTaskStatus.Enabled, + Platform = new ContainerRegistryPlatformProperties(ContainerRegistryOS.Linux) + { + Architecture = ContainerRegistryOSArchitecture.Amd64, + }, + AgentCpu = 2, + Step = new ContainerRegistryDockerBuildStep("src/DockerFile") + { + ImageNames = { "azurerest:testtag" }, + IsPushEnabled = true, + NoCache = false, + Arguments = {new ContainerRegistryRunArgument("mytestargument", "mytestvalue") +{ +IsSecret = false, +}, new ContainerRegistryRunArgument("mysecrettestargument", "mysecrettestvalue") +{ +IsSecret = true, +}}, + ContextPath = "src", + }, + Trigger = new ContainerRegistryTriggerProperties + { + TimerTriggers = { new ContainerRegistryTimerTrigger("30 9 * * 1-5", "myTimerTrigger") }, + SourceTriggers = {new ContainerRegistrySourceTrigger(new SourceCodeRepoProperties(SourceControlType.Github, new Uri("https://github.com/Azure/azure-rest-api-specs")) +{ +Branch = "master", +SourceControlAuthProperties = new SourceCodeRepoAuthInfo(SourceCodeRepoAuthTokenType.Pat, "xxxxx"), +}, new ContainerRegistrySourceTriggerEvent[]{ContainerRegistrySourceTriggerEvent.Commit}, "mySourceTrigger")}, + BaseImageTrigger = new ContainerRegistryBaseImageTrigger(ContainerRegistryBaseImageTriggerType.Runtime, "myBaseImageTrigger"), + }, + Credentials = new ContainerRegistryCredentials + { + SourceRegistry = new SourceRegistryCredentials + { + Identity = "[system]", + }, + }, + LogTemplate = null, + IsSystemTask = false, + Tags = +{ +["testkey"] = "value" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, taskName, data); + ContainerRegistryTaskResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryTaskData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_TasksCreateWithSystemAndUserIdentities() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json // this example is just showing the usage of "Tasks_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -231,7 +313,7 @@ public async Task CreateOrUpdate_TasksCreateWithSystemAndUserIdentities() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_TasksCreateWithUserIdentities() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json // this example is just showing the usage of "Tasks_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -317,7 +399,7 @@ public async Task CreateOrUpdate_TasksCreateWithUserIdentities() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_TasksCreateWithUserIdentitiesWithSystemIdentity() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json // this example is just showing the usage of "Tasks_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -392,7 +474,7 @@ public async Task CreateOrUpdate_TasksCreateWithUserIdentitiesWithSystemIdentity [Ignore("Only validating compilation of examples")] public async Task Get_TasksGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksGet.json // this example is just showing the usage of "Tasks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -426,7 +508,7 @@ public async Task Get_TasksGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_TasksList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksList.json // this example is just showing the usage of "Tasks_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -462,7 +544,7 @@ public async Task GetAll_TasksList() [Ignore("Only validating compilation of examples")] public async Task Exists_TasksGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksGet.json // this example is just showing the usage of "Tasks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -492,7 +574,7 @@ public async Task Exists_TasksGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_TasksGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksGet.json // this example is just showing the usage of "Tasks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskResource.cs index f9127b8a0587..1f47674ee635 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryTaskResource [Ignore("Only validating compilation of examples")] public async Task Get_TasksGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksGet.json // this example is just showing the usage of "Tasks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_TasksGet() [Ignore("Only validating compilation of examples")] public async Task Delete_TasksDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksDelete.json // this example is just showing the usage of "Tasks_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_TasksDelete() [Ignore("Only validating compilation of examples")] public async Task Update_TasksUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksUpdate.json // this example is just showing the usage of "Tasks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -146,8 +146,7 @@ public async Task Update_TasksUpdate() }, LogTemplate = "acr/tasks:{{.Run.OS}}", }; - ArmOperation lro = await containerRegistryTask.UpdateAsync(WaitUntil.Completed, patch); - ContainerRegistryTaskResource result = lro.Value; + ContainerRegistryTaskResource result = await containerRegistryTask.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -160,7 +159,7 @@ public async Task Update_TasksUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_TasksUpdateQuickTask() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_QuickTask.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksUpdate_QuickTask.json // this example is just showing the usage of "Tasks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -187,8 +186,7 @@ public async Task Update_TasksUpdateQuickTask() Status = ContainerRegistryTaskStatus.Enabled, LogTemplate = "acr/tasks:{{.Run.OS}}", }; - ArmOperation lro = await containerRegistryTask.UpdateAsync(WaitUntil.Completed, patch); - ContainerRegistryTaskResource result = lro.Value; + ContainerRegistryTaskResource result = await containerRegistryTask.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -201,7 +199,7 @@ public async Task Update_TasksUpdateQuickTask() [Ignore("Only validating compilation of examples")] public async Task Update_TasksUpdateWithKeyVaultCustomCredentials() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json // this example is just showing the usage of "Tasks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -269,8 +267,75 @@ public async Task Update_TasksUpdateWithKeyVaultCustomCredentials() }, LogTemplate = null, }; - ArmOperation lro = await containerRegistryTask.UpdateAsync(WaitUntil.Completed, patch); - ContainerRegistryTaskResource result = lro.Value; + ContainerRegistryTaskResource result = await containerRegistryTask.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryTaskData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_TasksUpdateWithLoginIdentity() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithLoginIdentity.json + // this example is just showing the usage of "Tasks_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryTaskResource created on azure + // for more information of creating ContainerRegistryTaskResource, please refer to the document of ContainerRegistryTaskResource + string subscriptionId = "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string taskName = "myTask"; + ResourceIdentifier containerRegistryTaskResourceId = ContainerRegistryTaskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, taskName); + ContainerRegistryTaskResource containerRegistryTask = client.GetContainerRegistryTaskResource(containerRegistryTaskResourceId); + + // invoke the operation + ContainerRegistryTaskPatch patch = new ContainerRegistryTaskPatch + { + Tags = +{ +["testkey"] = "value" +}, + Status = ContainerRegistryTaskStatus.Enabled, + AgentCpu = 3, + Step = new ContainerRegistryDockerBuildStepUpdateContent + { + ImageNames = { "azurerest:testtag1" }, + DockerFilePath = "src/DockerFile", + }, + Trigger = new ContainerRegistryTriggerUpdateContent + { + SourceTriggers = {new ContainerRegistrySourceTriggerUpdateContent("mySourceTrigger") +{ +SourceRepository = new SourceCodeRepoUpdateContent +{ +SourceControlAuthProperties = new SourceCodeRepoAuthInfoUpdateContent +{ +TokenType = SourceCodeRepoAuthTokenType.Pat, +Token = "xxxxx", +}, +}, +SourceTriggerEvents = {ContainerRegistrySourceTriggerEvent.Commit}, +}}, + }, + Credentials = new ContainerRegistryCredentials + { + SourceRegistry = new SourceRegistryCredentials + { + Identity = "[system]", + }, + }, + LogTemplate = null, + }; + ContainerRegistryTaskResource result = await containerRegistryTask.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -283,7 +348,7 @@ public async Task Update_TasksUpdateWithKeyVaultCustomCredentials() [Ignore("Only validating compilation of examples")] public async Task Update_TasksUpdateWithMSICustomCredentials() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json // this example is just showing the usage of "Tasks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -341,8 +406,7 @@ public async Task Update_TasksUpdateWithMSICustomCredentials() }, LogTemplate = null, }; - ArmOperation lro = await containerRegistryTask.UpdateAsync(WaitUntil.Completed, patch); - ContainerRegistryTaskResource result = lro.Value; + ContainerRegistryTaskResource result = await containerRegistryTask.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -355,7 +419,7 @@ public async Task Update_TasksUpdateWithMSICustomCredentials() [Ignore("Only validating compilation of examples")] public async Task Update_TasksUpdateWithOpaqueCustomCredentials() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json // this example is just showing the usage of "Tasks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -422,8 +486,7 @@ public async Task Update_TasksUpdateWithOpaqueCustomCredentials() }, LogTemplate = null, }; - ArmOperation lro = await containerRegistryTask.UpdateAsync(WaitUntil.Completed, patch); - ContainerRegistryTaskResource result = lro.Value; + ContainerRegistryTaskResource result = await containerRegistryTask.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -436,7 +499,7 @@ public async Task Update_TasksUpdateWithOpaqueCustomCredentials() [Ignore("Only validating compilation of examples")] public async Task GetDetails_TasksGetDetails() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGetDetails.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TasksGetDetails.json // this example is just showing the usage of "Tasks_GetDetails" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskRunCollection.cs index 48ec6347c2c4..1ce8f6348f4a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskRunCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskRunCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryTaskRunCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_TaskRunsCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TaskRunsCreate.json // this example is just showing the usage of "TaskRuns_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_TaskRunsCreate() [Ignore("Only validating compilation of examples")] public async Task Get_TaskRunsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TaskRunsGet.json // this example is just showing the usage of "TaskRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Get_TaskRunsGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_TaskRunsList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TaskRunsList.json // this example is just showing the usage of "TaskRuns_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_TaskRunsList() [Ignore("Only validating compilation of examples")] public async Task Exists_TaskRunsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TaskRunsGet.json // this example is just showing the usage of "TaskRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task Exists_TaskRunsGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_TaskRunsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TaskRunsGet.json // this example is just showing the usage of "TaskRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskRunResource.cs index 8e460c768aaa..afbb379de4d2 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskRunResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTaskRunResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryTaskRunResource [Ignore("Only validating compilation of examples")] public async Task Get_TaskRunsGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TaskRunsGet.json // this example is just showing the usage of "TaskRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_TaskRunsGet() [Ignore("Only validating compilation of examples")] public async Task Delete_TaskRunsDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TaskRunsDelete.json // this example is just showing the usage of "TaskRuns_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_TaskRunsDelete() [Ignore("Only validating compilation of examples")] public async Task Update_TaskRunsUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TaskRunsUpdate.json // this example is just showing the usage of "TaskRuns_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Update_TaskRunsUpdate() [Ignore("Only validating compilation of examples")] public async Task GetDetails_TaskRunsGetDetails() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGetDetails.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TaskRunsGetDetails.json // this example is just showing the usage of "TaskRuns_GetDetails" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenCollection.cs index cf1eac36fb10..b8e4899c34f2 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryTokenCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_TokenCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/TokenCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TokenCreate.json // this example is just showing the usage of "Tokens_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_TokenCreate() [Ignore("Only validating compilation of examples")] public async Task Get_TokenGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/TokenGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TokenGet.json // this example is just showing the usage of "Tokens_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Get_TokenGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_TokenList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/TokenList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TokenList.json // this example is just showing the usage of "Tokens_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_TokenList() [Ignore("Only validating compilation of examples")] public async Task Exists_TokenGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/TokenGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TokenGet.json // this example is just showing the usage of "Tokens_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task Exists_TokenGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_TokenGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/TokenGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TokenGet.json // this example is just showing the usage of "Tokens_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenResource.cs index 69720c6629fb..adbfff486191 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryTokenResource [Ignore("Only validating compilation of examples")] public async Task Get_TokenGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/TokenGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TokenGet.json // this example is just showing the usage of "Tokens_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_TokenGet() [Ignore("Only validating compilation of examples")] public async Task Delete_TokenDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/TokenDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TokenDelete.json // this example is just showing the usage of "Tokens_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_TokenDelete() [Ignore("Only validating compilation of examples")] public async Task Update_TokenUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/TokenUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/TokenUpdate.json // this example is just showing the usage of "Tokens_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookCollection.cs index accba0ea9b21..efaf1980601f 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryWebhookCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_WebhookCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookCreate.json // this example is just showing the usage of "Webhooks_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -70,7 +70,7 @@ public async Task CreateOrUpdate_WebhookCreate() [Ignore("Only validating compilation of examples")] public async Task Get_WebhookGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookGet.json // this example is just showing the usage of "Webhooks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -104,7 +104,7 @@ public async Task Get_WebhookGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_WebhookList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookList.json // this example is just showing the usage of "Webhooks_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +140,7 @@ public async Task GetAll_WebhookList() [Ignore("Only validating compilation of examples")] public async Task Exists_WebhookGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookGet.json // this example is just showing the usage of "Webhooks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task Exists_WebhookGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_WebhookGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookGet.json // this example is just showing the usage of "Webhooks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookResource.cs index 2ab59c7ff1e4..ce30eeaddcaa 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryWebhookResource [Ignore("Only validating compilation of examples")] public async Task Get_WebhookGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookGet.json // this example is just showing the usage of "Webhooks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_WebhookGet() [Ignore("Only validating compilation of examples")] public async Task Delete_WebhookDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookDelete.json // this example is just showing the usage of "Webhooks_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_WebhookDelete() [Ignore("Only validating compilation of examples")] public async Task Update_WebhookUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookUpdate.json // this example is just showing the usage of "Webhooks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Update_WebhookUpdate() [Ignore("Only validating compilation of examples")] public async Task Ping_WebhookPing() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookPing.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookPing.json // this example is just showing the usage of "Webhooks_Ping" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,7 +152,7 @@ public async Task Ping_WebhookPing() [Ignore("Only validating compilation of examples")] public async Task GetEvents_WebhookListEvents() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookListEvents.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookListEvents.json // this example is just showing the usage of "Webhooks_ListEvents" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -182,7 +182,7 @@ public async Task GetEvents_WebhookListEvents() [Ignore("Only validating compilation of examples")] public async Task GetCallbackConfig_WebhookGetCallbackConfig() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/WebhookGetCallbackConfig.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/WebhookGetCallbackConfig.json // this example is just showing the usage of "Webhooks_GetCallbackConfig" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapCollection.cs index 3d8e42b903aa..8fa7432982f0 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ScopeMapCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ScopeMapCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ScopeMapCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ScopeMapCreate.json // this example is just showing the usage of "ScopeMaps_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task CreateOrUpdate_ScopeMapCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ScopeMapGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ScopeMapGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ScopeMapGet.json // this example is just showing the usage of "ScopeMaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_ScopeMapGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ScopeMapList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ScopeMapList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ScopeMapList.json // this example is just showing the usage of "ScopeMaps_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetAll_ScopeMapList() [Ignore("Only validating compilation of examples")] public async Task Exists_ScopeMapGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ScopeMapGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ScopeMapGet.json // this example is just showing the usage of "ScopeMaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task Exists_ScopeMapGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ScopeMapGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ScopeMapGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ScopeMapGet.json // this example is just showing the usage of "ScopeMaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapResource.cs index e39d51f6bd24..57182586e551 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ScopeMapResource [Ignore("Only validating compilation of examples")] public async Task Get_ScopeMapGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ScopeMapGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ScopeMapGet.json // this example is just showing the usage of "ScopeMaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_ScopeMapGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ScopeMapDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ScopeMapDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ScopeMapDelete.json // this example is just showing the usage of "ScopeMaps_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_ScopeMapDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ScopeMapUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/ScopeMapUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/ScopeMapUpdate.json // this example is just showing the usage of "ScopeMaps_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index b7b460769375..11353685a001 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameAvailable() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryCheckNameAvailable.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryCheckNameAvailable.json // this example is just showing the usage of "Registries_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -36,7 +36,11 @@ public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameAvaila SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - ContainerRegistryNameAvailabilityContent content = new ContainerRegistryNameAvailabilityContent("myRegistry"); + ContainerRegistryNameAvailabilityContent content = new ContainerRegistryNameAvailabilityContent("myRegistry") + { + ResourceGroupName = "myResourceGroup", + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.ResourceGroupReuse, + }; ContainerRegistryNameAvailableResult result = await subscriptionResource.CheckContainerRegistryNameAvailabilityAsync(content); Console.WriteLine($"Succeeded: {result}"); @@ -46,7 +50,7 @@ public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameAvaila [Ignore("Only validating compilation of examples")] public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameNotAvailable() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryCheckNameNotAvailable.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryCheckNameNotAvailable.json // this example is just showing the usage of "Registries_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +65,11 @@ public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameNotAva SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - ContainerRegistryNameAvailabilityContent content = new ContainerRegistryNameAvailabilityContent("myRegistry"); + ContainerRegistryNameAvailabilityContent content = new ContainerRegistryNameAvailabilityContent("myRegistry") + { + ResourceGroupName = "myResourceGroup", + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.ResourceGroupReuse, + }; ContainerRegistryNameAvailableResult result = await subscriptionResource.CheckContainerRegistryNameAvailabilityAsync(content); Console.WriteLine($"Succeeded: {result}"); @@ -71,7 +79,7 @@ public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameNotAva [Ignore("Only validating compilation of examples")] public async Task GetContainerRegistries_RegistryList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2025-04-01/examples/RegistryList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-06-01-preview/examples/RegistryList.json // this example is just showing the usage of "Registries_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ArmContainerRegistryModelFactory.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ArmContainerRegistryModelFactory.cs index 22250a1b72f1..58edfff9ae0a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ArmContainerRegistryModelFactory.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ArmContainerRegistryModelFactory.cs @@ -17,6 +17,52 @@ namespace Azure.ResourceManager.ContainerRegistry.Models /// Model factory for models. public static partial class ArmContainerRegistryModelFactory { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The package source of the archive. + /// The published version of the archive. + /// + /// + /// The provisioning state of the archive at the time the operation was called. + /// A new instance for mocking. + public static ContainerRegistryArchiveData ContainerRegistryArchiveData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ArchivePackageSourceProperties packageSource = null, string publishedVersion = null, string repositoryEndpointPrefix = null, string repositoryEndpoint = null, ContainerRegistryProvisioningState? provisioningState = null) + { + return new ContainerRegistryArchiveData( + id, + name, + resourceType, + systemData, + packageSource, + publishedVersion, + repositoryEndpointPrefix, + repositoryEndpoint, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the archive at the time the operation was called. + /// The detailed error message for the archive version in the case of failure. + /// A new instance for mocking. + public static ContainerRegistryArchiveVersionData ContainerRegistryArchiveVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerRegistryProvisioningState? provisioningState = null, string archiveVersionErrorMessage = null) + { + return new ContainerRegistryArchiveVersionData( + id, + name, + resourceType, + systemData, + provisioningState, + archiveVersionErrorMessage, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -56,8 +102,8 @@ public static ContainerRegistryCacheRuleData ContainerRegistryCacheRuleData(Reso /// The current version of ACR runtime on the connected registry. /// The current connection state of the connected registry. /// The last activity time of the connected registry. - /// - /// The properties of the connected registry parent. + /// The activation properties of the connected registry. + /// The parent of the connected registry. /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. /// The login server properties of the connected registry. /// The logging properties of the connected registry. @@ -81,7 +127,7 @@ public static ConnectedRegistryData ConnectedRegistryData(ResourceIdentifier id version, connectionState, lastActivityOn, - activationStatus != null ? new ConnectedRegistryPropertiesActivation(activationStatus, serializedAdditionalRawData: null) : null, + activationStatus != null ? new ConnectedRegistryActivation(activationStatus, serializedAdditionalRawData: null) : null, parent, clientTokenIds?.ToList(), loginServer, @@ -209,6 +255,34 @@ public static ContainerRegistryCredentialHealth ContainerRegistryCredentialHealt return new ContainerRegistryCredentialHealth(status, errorCode, errorMessage, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The location of the export pipeline. + /// The identity of the export pipeline. + /// The target properties of the export pipeline. + /// The list of all options configured for the pipeline. + /// The provisioning state of the pipeline at the time the operation was called. + /// A new instance for mocking. + public static ContainerRegistryExportPipelineData ContainerRegistryExportPipelineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ExportPipelineTargetProperties target = null, IEnumerable options = null, ContainerRegistryProvisioningState? provisioningState = null) + { + options ??= new List(); + + return new ContainerRegistryExportPipelineData( + id, + name, + resourceType, + systemData, + location, + identity, + target, + options?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The source of the image. /// List of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). @@ -248,23 +322,110 @@ public static ContainerRegistryImportSourceCredentials ContainerRegistryImportSo return new ContainerRegistryImportSourceCredentials(username, password, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The location of the import pipeline. + /// The identity of the import pipeline. + /// The source properties of the import pipeline. + /// The properties that describe the trigger of the import pipeline. + /// The list of all options configured for the pipeline. + /// The provisioning state of the pipeline at the time the operation was called. + /// A new instance for mocking. + public static ContainerRegistryImportPipelineData ContainerRegistryImportPipelineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ImportPipelineSourceProperties source = null, ContainerRegistryTriggerStatus? sourceTriggerStatus = null, IEnumerable options = null, ContainerRegistryProvisioningState? provisioningState = null) + { + options ??= new List(); + + return new ContainerRegistryImportPipelineData( + id, + name, + resourceType, + systemData, + location, + identity, + source, + sourceTriggerStatus.HasValue ? new PipelineTriggerProperties(new PipelineSourceTriggerProperties(sourceTriggerStatus.Value, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, + options?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The name of the container registry. /// The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + /// The resource group name of the container registry. + /// The auto generated domain name label of the container registry. This value defaults to "Unsecure". /// A new instance for mocking. - public static ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, ContainerRegistryResourceType resourceType = default) + public static ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, ContainerRegistryResourceType resourceType = default, string resourceGroupName = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null) { - return new ContainerRegistryNameAvailabilityContent(name, resourceType, serializedAdditionalRawData: null); + return new ContainerRegistryNameAvailabilityContent(name, resourceType, resourceGroupName, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData: null); } /// Initializes a new instance of . + /// The complete login server name with domain name label (DNL) hash, if available. /// The value that indicates whether the name is available. /// If any, the reason that the name is not available. /// If any, the error message that provides more detail for the reason that the name is not available. /// A new instance for mocking. - public static ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable = null, string reason = null, string message = null) + public static ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(string availableLoginServerName = null, bool? isNameAvailable = null, string reason = null, string message = null) + { + return new ContainerRegistryNameAvailableResult(availableLoginServerName, isNameAvailable, reason, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of a pipeline run. + /// The request parameters for a pipeline run. + /// The response of a pipeline run. + /// How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. + /// A new instance for mocking. + public static ContainerRegistryPipelineRunData ContainerRegistryPipelineRunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerRegistryProvisioningState? provisioningState = null, ConnectedRegistryPipelineRunContent request = null, PipelineRunResult response = null, string forceUpdateTag = null) { - return new ContainerRegistryNameAvailableResult(isNameAvailable, reason, message, serializedAdditionalRawData: null); + return new ContainerRegistryPipelineRunData( + id, + name, + resourceType, + systemData, + provisioningState, + request, + response, + forceUpdateTag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The current status of the pipeline run. + /// The artifacts imported in the pipeline run. + /// The current progress of the copy operation. + /// The time the pipeline run started. + /// The time the pipeline run finished. + /// The source of the pipeline run. + /// The target of the pipeline run. + /// The digest of the tar used to transfer the artifacts. + /// The trigger that caused the pipeline run. + /// The detailed error message for the pipeline run in the case of failure. + /// A new instance for mocking. + public static PipelineRunResult PipelineRunResult(string status = null, IEnumerable importedArtifacts = null, string progressPercentage = null, DateTimeOffset? startOn = null, DateTimeOffset? finishOn = null, ImportPipelineSourceProperties source = null, ExportPipelineTargetProperties target = null, string catalogDigest = null, DateTimeOffset? sourceTriggerTimestamp = null, string pipelineRunErrorMessage = null) + { + importedArtifacts ??= new List(); + + return new PipelineRunResult( + status, + importedArtifacts?.ToList(), + progressPercentage != null ? new PipelineProgress(progressPercentage, serializedAdditionalRawData: null) : null, + startOn, + finishOn, + source, + target, + catalogDigest, + sourceTriggerTimestamp != null ? new PipelineTriggerDescriptor(new PipelineSourceTriggerDescriptor(sourceTriggerTimestamp, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, + pipelineRunErrorMessage, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -313,8 +474,11 @@ public static ContainerRegistryPrivateEndpointConnectionData ContainerRegistryPr /// Whether to allow trusted Azure services to access a network restricted registry. /// Whether or not zone redundancy is enabled for this container registry. /// Enables registry-wide pull from unauthenticated clients. + /// Determines whether registry artifacts are indexed for metadata search. + /// Determines the domain name label reuse scope. + /// Determines registry role assignment mode. /// A new instance for mocking. - public static ContainerRegistryData ContainerRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ContainerRegistrySku sku = null, ManagedServiceIdentity identity = null, string loginServer = null, DateTimeOffset? createdOn = null, ContainerRegistryProvisioningState? provisioningState = null, ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = null, ContainerRegistryNetworkRuleSet networkRuleSet = null, ContainerRegistryPolicies policies = null, ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = null, IEnumerable dataEndpointHostNames = null, IEnumerable privateEndpointConnections = null, ContainerRegistryPublicNetworkAccess? publicNetworkAccess = null, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = null, ContainerRegistryZoneRedundancy? zoneRedundancy = null, bool? isAnonymousPullEnabled = null) + public static ContainerRegistryData ContainerRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ContainerRegistrySku sku = null, ManagedServiceIdentity identity = null, string loginServer = null, DateTimeOffset? createdOn = null, ContainerRegistryProvisioningState? provisioningState = null, ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = null, ContainerRegistryNetworkRuleSet networkRuleSet = null, ContainerRegistryPolicies policies = null, ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = null, IEnumerable dataEndpointHostNames = null, IEnumerable privateEndpointConnections = null, ContainerRegistryPublicNetworkAccess? publicNetworkAccess = null, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = null, ContainerRegistryZoneRedundancy? zoneRedundancy = null, bool? isAnonymousPullEnabled = null, ContainerRegistryMetadataSearch? metadataSearch = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null, ContainerRegistryRoleAssignmentMode? roleAssignmentMode = null) { tags ??= new Dictionary(); dataEndpointHostNames ??= new List(); @@ -344,6 +508,9 @@ public static ContainerRegistryData ContainerRegistryData(ResourceIdentifier id networkRuleBypassOptions, zoneRedundancy, isAnonymousPullEnabled, + metadataSearch, + autoGeneratedDomainNameLabelScope, + roleAssignmentMode, serializedAdditionalRawData: null); } @@ -376,6 +543,16 @@ public static ContainerRegistryRetentionPolicy ContainerRegistryRetentionPolicy( return new ContainerRegistryRetentionPolicy(days, lastUpdatedOn, status, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The number of days after which a soft-deleted item is permanently deleted. + /// The timestamp when the policy was last updated. + /// The value that indicates whether the policy is enabled or not. + /// A new instance for mocking. + public static ContainerRegistrySoftDeletePolicy ContainerRegistrySoftDeletePolicy(int? retentionDays = null, DateTimeOffset? lastUpdatedOn = null, ContainerRegistryPolicyStatus? status = null) + { + return new ContainerRegistrySoftDeletePolicy(retentionDays, lastUpdatedOn, status, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Key vault uri to access the encryption key. /// The fully qualified key identifier that includes the version of the key that is actually used for encryption. @@ -1117,6 +1294,58 @@ public static ContainerRegistryEncodedTaskStep ContainerRegistryEncodedTaskStep( values?.ToList()); } + /// Initializes a new instance of . + /// The name of the container registry. + /// The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name, ContainerRegistryResourceType resourceType) + { + return ContainerRegistryNameAvailabilityContent(name: name, resourceType: resourceType, resourceGroupName: default, autoGeneratedDomainNameLabelScope: default); + } + + /// Initializes a new instance of . + /// The value that indicates whether the name is available. + /// If any, the reason that the name is not available. + /// If any, the error message that provides more detail for the reason that the name is not available. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable, string reason, string message) + { + return ContainerRegistryNameAvailableResult(availableLoginServerName: default, isNameAvailable: isNameAvailable, reason: reason, message: message); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The SKU of the container registry. + /// The identity of the container registry. + /// The URL that can be used to log into the container registry. + /// The creation date of the container registry in ISO8601 format. + /// The provisioning state of the container registry at the time the operation was called. + /// The status of the container registry at the time the operation was called. + /// The value that indicates whether the admin user is enabled. + /// The network rule set for a container registry. + /// The policies for a container registry. + /// The encryption settings of container registry. + /// Enable a single data endpoint per region for serving data. + /// List of host names that will serve data when dataEndpointEnabled is true. + /// List of private endpoint connections for a container registry. + /// Whether or not public network access is allowed for the container registry. + /// Whether to allow trusted Azure services to access a network restricted registry. + /// Whether or not zone redundancy is enabled for this container registry. + /// Enables registry-wide pull from unauthenticated clients. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerRegistryData ContainerRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerRegistrySku sku, ManagedServiceIdentity identity, string loginServer, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, IEnumerable dataEndpointHostNames, IEnumerable privateEndpointConnections, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, ContainerRegistryZoneRedundancy? zoneRedundancy, bool? isAnonymousPullEnabled) + { + return ContainerRegistryData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, identity: identity, loginServer: loginServer, createdOn: createdOn, provisioningState: provisioningState, status: status, isAdminUserEnabled: isAdminUserEnabled, networkRuleSet: networkRuleSet, policies: policies, encryption: encryption, isDataEndpointEnabled: isDataEndpointEnabled, dataEndpointHostNames: dataEndpointHostNames, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess, networkRuleBypassOptions: networkRuleBypassOptions, zoneRedundancy: zoneRedundancy, isAnonymousPullEnabled: isAnonymousPullEnabled, metadataSearch: default, autoGeneratedDomainNameLabelScope: default, roleAssignmentMode: default); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -1144,7 +1373,7 @@ public static ContainerRegistryEncodedTaskStep ContainerRegistryEncodedTaskStep( [EditorBrowsable(EditorBrowsableState.Never)] public static ContainerRegistryData ContainerRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerRegistrySku sku, ManagedServiceIdentity identity, string loginServer, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, IEnumerable dataEndpointHostNames, IEnumerable privateEndpointConnections, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, ContainerRegistryZoneRedundancy? zoneRedundancy) { - return ContainerRegistryData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, identity: identity, loginServer: loginServer, createdOn: createdOn, provisioningState: provisioningState, status: status, isAdminUserEnabled: isAdminUserEnabled, networkRuleSet: networkRuleSet, policies: policies, encryption: encryption, isDataEndpointEnabled: isDataEndpointEnabled, dataEndpointHostNames: dataEndpointHostNames, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess, networkRuleBypassOptions: networkRuleBypassOptions, zoneRedundancy: zoneRedundancy, isAnonymousPullEnabled: default); + return ContainerRegistryData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, identity: identity, loginServer: loginServer, createdOn: createdOn, provisioningState: provisioningState, status: status, isAdminUserEnabled: isAdminUserEnabled, networkRuleSet: networkRuleSet, policies: policies, encryption: encryption, isDataEndpointEnabled: isDataEndpointEnabled, dataEndpointHostNames: dataEndpointHostNames, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess, networkRuleBypassOptions: networkRuleBypassOptions, zoneRedundancy: zoneRedundancy, isAnonymousPullEnabled: default, metadataSearch: default, autoGeneratedDomainNameLabelScope: default, roleAssignmentMode: default); } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs index 80c59dc5486f..de342195d07f 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string c /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string connectedRegistryN /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(string filte /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string filter = null, /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string connectedRegistryNa /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string connectedRegistryName, CancellationT /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.Serialization.cs index a21b31a6a84a..c7c300cba272 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.Serialization.cs @@ -158,7 +158,7 @@ internal static ConnectedRegistryData DeserializeConnectedRegistryData(JsonEleme string version = default; ConnectedRegistryConnectionState? connectionState = default; DateTimeOffset? lastActivityTime = default; - ConnectedRegistryPropertiesActivation activation = default; + ConnectedRegistryActivation activation = default; ConnectedRegistryParent parent = default; IList clientTokenIds = default; ConnectedRegistryLoginServer loginServer = default; @@ -250,7 +250,7 @@ internal static ConnectedRegistryData DeserializeConnectedRegistryData(JsonEleme { continue; } - activation = ConnectedRegistryPropertiesActivation.DeserializeConnectedRegistryPropertiesActivation(property0.Value, options); + activation = ConnectedRegistryActivation.DeserializeConnectedRegistryActivation(property0.Value, options); continue; } if (property0.NameEquals("parent"u8)) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.cs index 30fc1097128c..d45939008e2b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.cs @@ -69,8 +69,8 @@ public ConnectedRegistryData() /// The current version of ACR runtime on the connected registry. /// The current connection state of the connected registry. /// The last activity time of the connected registry. - /// - /// The properties of the connected registry parent. + /// The activation properties of the connected registry. + /// The parent of the connected registry. /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. /// The login server properties of the connected registry. /// The logging properties of the connected registry. @@ -78,7 +78,7 @@ public ConnectedRegistryData() /// The list of notifications subscription information for the connected registry. /// The garbage collection properties of the connected registry. /// Keeps track of any properties unknown to the library. - internal ConnectedRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerRegistryProvisioningState? provisioningState, ConnectedRegistryMode? mode, string version, ConnectedRegistryConnectionState? connectionState, DateTimeOffset? lastActivityOn, ConnectedRegistryPropertiesActivation activation, ConnectedRegistryParent parent, IList clientTokenIds, ConnectedRegistryLoginServer loginServer, ConnectedRegistryLogging logging, IReadOnlyList statusDetails, IList notificationsList, GarbageCollectionProperties garbageCollection, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ConnectedRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerRegistryProvisioningState? provisioningState, ConnectedRegistryMode? mode, string version, ConnectedRegistryConnectionState? connectionState, DateTimeOffset? lastActivityOn, ConnectedRegistryActivation activation, ConnectedRegistryParent parent, IList clientTokenIds, ConnectedRegistryLoginServer loginServer, ConnectedRegistryLogging logging, IReadOnlyList statusDetails, IList notificationsList, GarbageCollectionProperties garbageCollection, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { ProvisioningState = provisioningState; Mode = mode; @@ -111,8 +111,8 @@ internal ConnectedRegistryData(ResourceIdentifier id, string name, ResourceType /// The last activity time of the connected registry. [WirePath("properties.lastActivityTime")] public DateTimeOffset? LastActivityOn { get; } - /// Gets the activation. - internal ConnectedRegistryPropertiesActivation Activation { get; } + /// The activation properties of the connected registry. + internal ConnectedRegistryActivation Activation { get; } /// The activation status of the connected registry. [WirePath("properties.activation.status")] public ConnectedRegistryActivationStatus? ActivationStatus @@ -120,7 +120,7 @@ public ConnectedRegistryActivationStatus? ActivationStatus get => Activation?.Status; } - /// The properties of the connected registry parent. + /// The parent of the connected registry. [WirePath("properties.parent")] public ConnectedRegistryParent Parent { get; set; } /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs index c8be909c06cf..f314f613a523 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual async Task DeactivateAsync(WaitUntil waitUntil, Can /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs index b6d53bd95218..31a50658e99d 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -88,7 +88,7 @@ public virtual async Task> Crea try { var response = await _containerRegistryAgentPoolAgentPoolsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -113,7 +113,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -137,7 +137,7 @@ public virtual ArmOperation CreateOrUpdate(W try { var response = _containerRegistryAgentPoolAgentPoolsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string agentPool /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string agentPoolName, Canc /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string agentPoolName, CancellationToken can /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolResource.cs index 81c919c9628e..eefa64828c73 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -288,7 +288,7 @@ public virtual async Task> Upda try { var response = await _containerRegistryAgentPoolAgentPoolsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -313,7 +313,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Update(WaitUntil try { var response = _containerRegistryAgentPoolAgentPoolsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual async Task> GetQu /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -435,7 +435,7 @@ public virtual Response GetQueueStatus(Ca /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -497,7 +497,7 @@ public virtual async Task> AddTagAs /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -559,7 +559,7 @@ public virtual Response AddTag(string key, s /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -616,7 +616,7 @@ public virtual async Task> SetTagsA /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -673,7 +673,7 @@ public virtual Response SetTags(IDictionary< /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -733,7 +733,7 @@ public virtual async Task> RemoveTa /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveCollection.cs new file mode 100644 index 000000000000..42e1444891cf --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryArchives method from an instance of . + /// + public partial class ContainerRegistryArchiveCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryArchiveArchivesClientDiagnostics; + private readonly ArchivesRestOperations _containerRegistryArchiveArchivesRestClient; + private readonly string _packageType; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryArchiveCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + /// The type of the package resource. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal ContainerRegistryArchiveCollection(ArmClient client, ResourceIdentifier id, string packageType) : base(client, id) + { + _packageType = packageType; + _containerRegistryArchiveArchivesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryArchiveResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryArchiveResource.ResourceType, out string containerRegistryArchiveArchivesApiVersion); + _containerRegistryArchiveArchivesRestClient = new ArchivesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryArchiveArchivesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the archive resource. + /// The parameters for creating a archive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string archiveName, ContainerRegistryArchiveData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveOperationSource(Client), _containerRegistryArchiveArchivesClientDiagnostics, Pipeline, _containerRegistryArchiveArchivesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the archive resource. + /// The parameters for creating a archive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string archiveName, ContainerRegistryArchiveData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveOperationSource(Client), _containerRegistryArchiveArchivesClientDiagnostics, Pipeline, _containerRegistryArchiveArchivesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all archives for the specified container registry and package type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives + /// + /// + /// Operation Id + /// Archives_List + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryArchiveArchivesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryArchiveArchivesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryArchiveResource(Client, ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(e)), _containerRegistryArchiveArchivesClientDiagnostics, Pipeline, "ContainerRegistryArchiveCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all archives for the specified container registry and package type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives + /// + /// + /// Operation Id + /// Archives_List + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryArchiveArchivesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryArchiveArchivesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryArchiveResource(Client, ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(e)), _containerRegistryArchiveArchivesClientDiagnostics, Pipeline, "ContainerRegistryArchiveCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.Serialization.cs new file mode 100644 index 000000000000..dbf448445800 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.Serialization.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryArchiveData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryArchiveData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(PackageSource)) + { + writer.WritePropertyName("packageSource"u8); + writer.WriteObjectValue(PackageSource, options); + } + if (Optional.IsDefined(PublishedVersion)) + { + writer.WritePropertyName("publishedVersion"u8); + writer.WriteStringValue(PublishedVersion); + } + if (Optional.IsDefined(RepositoryEndpointPrefix)) + { + writer.WritePropertyName("repositoryEndpointPrefix"u8); + writer.WriteStringValue(RepositoryEndpointPrefix); + } + if (options.Format != "W" && Optional.IsDefined(RepositoryEndpoint)) + { + writer.WritePropertyName("repositoryEndpoint"u8); + writer.WriteStringValue(RepositoryEndpoint); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + ContainerRegistryArchiveData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryArchiveData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryArchiveData(document.RootElement, options); + } + + internal static ContainerRegistryArchiveData DeserializeContainerRegistryArchiveData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ArchivePackageSourceProperties packageSource = default; + string publishedVersion = default; + string repositoryEndpointPrefix = default; + string repositoryEndpoint = default; + ContainerRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("packageSource"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + packageSource = ArchivePackageSourceProperties.DeserializeArchivePackageSourceProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("publishedVersion"u8)) + { + publishedVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("repositoryEndpointPrefix"u8)) + { + repositoryEndpointPrefix = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("repositoryEndpoint"u8)) + { + repositoryEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryArchiveData( + id, + name, + type, + systemData, + packageSource, + publishedVersion, + repositoryEndpointPrefix, + repositoryEndpoint, + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PackageSource), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" packageSource: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PackageSource)) + { + builder.Append(" packageSource: "); + BicepSerializationHelpers.AppendChildObject(builder, PackageSource, options, 4, false, " packageSource: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PublishedVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publishedVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PublishedVersion)) + { + builder.Append(" publishedVersion: "); + if (PublishedVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PublishedVersion}'''"); + } + else + { + builder.AppendLine($"'{PublishedVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RepositoryEndpointPrefix), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" repositoryEndpointPrefix: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RepositoryEndpointPrefix)) + { + builder.Append(" repositoryEndpointPrefix: "); + if (RepositoryEndpointPrefix.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RepositoryEndpointPrefix}'''"); + } + else + { + builder.AppendLine($"'{RepositoryEndpointPrefix}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RepositoryEndpoint), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" repositoryEndpoint: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RepositoryEndpoint)) + { + builder.Append(" repositoryEndpoint: "); + if (RepositoryEndpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RepositoryEndpoint}'''"); + } + else + { + builder.AppendLine($"'{RepositoryEndpoint}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryArchiveData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryArchiveData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerRegistryArchiveData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryArchiveData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.cs new file mode 100644 index 000000000000..d7c015df2738 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryArchive data model. + /// An object that represents a archive for a container registry. + /// + public partial class ContainerRegistryArchiveData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryArchiveData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The package source of the archive. + /// The published version of the archive. + /// + /// + /// The provisioning state of the archive at the time the operation was called. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryArchiveData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ArchivePackageSourceProperties packageSource, string publishedVersion, string repositoryEndpointPrefix, string repositoryEndpoint, ContainerRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + PackageSource = packageSource; + PublishedVersion = publishedVersion; + RepositoryEndpointPrefix = repositoryEndpointPrefix; + RepositoryEndpoint = repositoryEndpoint; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The package source of the archive. + [WirePath("properties.packageSource")] + public ArchivePackageSourceProperties PackageSource { get; set; } + /// The published version of the archive. + [WirePath("properties.publishedVersion")] + public string PublishedVersion { get; set; } + /// Gets or sets the repository endpoint prefix. + [WirePath("properties.repositoryEndpointPrefix")] + public string RepositoryEndpointPrefix { get; set; } + /// Gets the repository endpoint. + [WirePath("properties.repositoryEndpoint")] + public string RepositoryEndpoint { get; } + /// The provisioning state of the archive at the time the operation was called. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.Serialization.cs new file mode 100644 index 000000000000..29329a302841 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryArchiveResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryArchiveData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerContainerRegistryContext.Default); + + ContainerRegistryArchiveData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerContainerRegistryContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.cs new file mode 100644 index 000000000000..030dbdbdef64 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.cs @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryArchive along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryArchiveResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryArchive method. + /// + public partial class ContainerRegistryArchiveResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The packageType. + /// The archiveName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryArchiveArchivesClientDiagnostics; + private readonly ArchivesRestOperations _containerRegistryArchiveArchivesRestClient; + private readonly ContainerRegistryArchiveData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/packages/archives"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryArchiveResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryArchiveResource(ArmClient client, ContainerRegistryArchiveData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryArchiveResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryArchiveArchivesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryArchiveArchivesApiVersion); + _containerRegistryArchiveArchivesRestClient = new ArchivesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryArchiveArchivesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryArchiveData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of ContainerRegistryArchiveVersionResources in the ContainerRegistryArchive. + /// An object representing collection of ContainerRegistryArchiveVersionResources and their operations over a ContainerRegistryArchiveVersionResource. + public virtual ContainerRegistryArchiveVersionCollection GetContainerRegistryArchiveVersions() + { + return GetCachedClient(client => new ContainerRegistryArchiveVersionCollection(client, Id)); + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryArchiveVersionAsync(string archiveVersionName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryArchiveVersions().GetAsync(archiveVersionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryArchiveVersion(string archiveVersionName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryArchiveVersions().Get(archiveVersionName, cancellationToken); + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a archive from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Delete + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryArchiveArchivesClientDiagnostics, Pipeline, _containerRegistryArchiveArchivesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a archive from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Delete + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryArchiveArchivesClientDiagnostics, Pipeline, _containerRegistryArchiveArchivesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Update + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters for updating a archive. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ContainerRegistryArchivePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Update + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters for updating a archive. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ContainerRegistryArchivePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionCollection.cs new file mode 100644 index 000000000000..6e517c14bc61 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionCollection.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryArchiveVersions method from an instance of . + /// + public partial class ContainerRegistryArchiveVersionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics; + private readonly ArchiveVersionsRestOperations _containerRegistryArchiveVersionArchiveVersionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryArchiveVersionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerRegistryArchiveVersionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryArchiveVersionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryArchiveVersionResource.ResourceType, out string containerRegistryArchiveVersionArchiveVersionsApiVersion); + _containerRegistryArchiveVersionArchiveVersionsRestClient = new ArchiveVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryArchiveVersionArchiveVersionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryArchiveResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryArchiveResource.ResourceType), nameof(id)); + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveVersionOperationSource(Client), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveVersionOperationSource(Client), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions + /// + /// + /// Operation Id + /// ArchiveVersions_List + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryArchiveVersionResource(Client, ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(e)), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, "ContainerRegistryArchiveVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions + /// + /// + /// Operation Id + /// ArchiveVersions_List + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryArchiveVersionResource(Client, ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(e)), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, "ContainerRegistryArchiveVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.Serialization.cs new file mode 100644 index 000000000000..7afcee17be75 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.Serialization.cs @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryArchiveVersionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryArchiveVersionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ArchiveVersionErrorMessage)) + { + writer.WritePropertyName("archiveVersionErrorMessage"u8); + writer.WriteStringValue(ArchiveVersionErrorMessage); + } + writer.WriteEndObject(); + } + + ContainerRegistryArchiveVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryArchiveVersionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryArchiveVersionData(document.RootElement, options); + } + + internal static ContainerRegistryArchiveVersionData DeserializeContainerRegistryArchiveVersionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ContainerRegistryProvisioningState? provisioningState = default; + string archiveVersionErrorMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("archiveVersionErrorMessage"u8)) + { + archiveVersionErrorMessage = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryArchiveVersionData( + id, + name, + type, + systemData, + provisioningState, + archiveVersionErrorMessage, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ArchiveVersionErrorMessage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" archiveVersionErrorMessage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ArchiveVersionErrorMessage)) + { + builder.Append(" archiveVersionErrorMessage: "); + if (ArchiveVersionErrorMessage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ArchiveVersionErrorMessage}'''"); + } + else + { + builder.AppendLine($"'{ArchiveVersionErrorMessage}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryArchiveVersionData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryArchiveVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerRegistryArchiveVersionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryArchiveVersionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.cs new file mode 100644 index 000000000000..7d4cb16a8cf6 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryArchiveVersion data model. + /// An object that represents an export pipeline for a container registry. + /// + public partial class ContainerRegistryArchiveVersionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryArchiveVersionData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the archive at the time the operation was called. + /// The detailed error message for the archive version in the case of failure. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryArchiveVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerRegistryProvisioningState? provisioningState, string archiveVersionErrorMessage, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + ArchiveVersionErrorMessage = archiveVersionErrorMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioning state of the archive at the time the operation was called. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + /// The detailed error message for the archive version in the case of failure. + [WirePath("properties.archiveVersionErrorMessage")] + public string ArchiveVersionErrorMessage { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.Serialization.cs new file mode 100644 index 000000000000..b72b285765ff --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryArchiveVersionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryArchiveVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerContainerRegistryContext.Default); + + ContainerRegistryArchiveVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerContainerRegistryContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.cs new file mode 100644 index 000000000000..bd94d22fc8a0 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryArchiveVersion along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryArchiveVersionResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryArchiveVersion method. + /// + public partial class ContainerRegistryArchiveVersionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The packageType. + /// The archiveName. + /// The archiveVersionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics; + private readonly ArchiveVersionsRestOperations _containerRegistryArchiveVersionArchiveVersionsRestClient; + private readonly ContainerRegistryArchiveVersionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/packages/archives/versions"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryArchiveVersionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryArchiveVersionResource(ArmClient client, ContainerRegistryArchiveVersionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryArchiveVersionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryArchiveVersionArchiveVersionsApiVersion); + _containerRegistryArchiveVersionArchiveVersionsRestClient = new ArchiveVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryArchiveVersionArchiveVersionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryArchiveVersionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a archive version from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Delete + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a archive version from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Delete + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveVersionOperationSource(Client), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Update(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveVersionOperationSource(Client), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleCollection.cs index edee44a67e74..de2309b9d91f 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string cacheRule /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string cacheRuleName, Canc /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string cacheRuleName, CancellationToken can /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.cs index c678eee7fb9b..52104f32c3ed 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs index 61a650d420a9..bac6cea0d15d 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string r /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string registryName, Canc /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string registryName, Cance /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string registryName, CancellationToken canc /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetCollection.cs index 9557fe1e0d76..cb2e3a524176 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string crede /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string credentialSetName, /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string credentialSetName, CancellationToken /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.cs index f0cfd4a45b2c..2d3463c58c17 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.Serialization.cs index 550af969e122..0d3381f80cd4 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.Serialization.cs @@ -133,6 +133,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("anonymousPullEnabled"u8); writer.WriteBooleanValue(IsAnonymousPullEnabled.Value); } + if (Optional.IsDefined(MetadataSearch)) + { + writer.WritePropertyName("metadataSearch"u8); + writer.WriteStringValue(MetadataSearch.Value.ToString()); + } + if (Optional.IsDefined(AutoGeneratedDomainNameLabelScope)) + { + writer.WritePropertyName("autoGeneratedDomainNameLabelScope"u8); + writer.WriteStringValue(AutoGeneratedDomainNameLabelScope.Value.ToString()); + } + if (Optional.IsDefined(RoleAssignmentMode)) + { + writer.WritePropertyName("roleAssignmentMode"u8); + writer.WriteStringValue(RoleAssignmentMode.Value.ToString()); + } writer.WriteEndObject(); } @@ -179,6 +194,9 @@ internal static ContainerRegistryData DeserializeContainerRegistryData(JsonEleme ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default; ContainerRegistryZoneRedundancy? zoneRedundancy = default; bool? anonymousPullEnabled = default; + ContainerRegistryMetadataSearch? metadataSearch = default; + AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default; + ContainerRegistryRoleAssignmentMode? roleAssignmentMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -390,6 +408,33 @@ internal static ContainerRegistryData DeserializeContainerRegistryData(JsonEleme anonymousPullEnabled = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("metadataSearch"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metadataSearch = new ContainerRegistryMetadataSearch(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("autoGeneratedDomainNameLabelScope"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoGeneratedDomainNameLabelScope = new AutoGeneratedDomainNameLabelScope(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("roleAssignmentMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + roleAssignmentMode = new ContainerRegistryRoleAssignmentMode(property0.Value.GetString()); + continue; + } } continue; } @@ -423,6 +468,9 @@ internal static ContainerRegistryData DeserializeContainerRegistryData(JsonEleme networkRuleBypassOptions, zoneRedundancy, anonymousPullEnabled, + metadataSearch, + autoGeneratedDomainNameLabelScope, + roleAssignmentMode, serializedAdditionalRawData); } @@ -837,6 +885,51 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MetadataSearch), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadataSearch: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MetadataSearch)) + { + builder.Append(" metadataSearch: "); + builder.AppendLine($"'{MetadataSearch.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AutoGeneratedDomainNameLabelScope), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" autoGeneratedDomainNameLabelScope: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AutoGeneratedDomainNameLabelScope)) + { + builder.Append(" autoGeneratedDomainNameLabelScope: "); + builder.AppendLine($"'{AutoGeneratedDomainNameLabelScope.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RoleAssignmentMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" roleAssignmentMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RoleAssignmentMode)) + { + builder.Append(" roleAssignmentMode: "); + builder.AppendLine($"'{RoleAssignmentMode.Value.ToString()}'"); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs index 5a71a85d65f4..bef46a7aabb0 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs @@ -88,8 +88,11 @@ public ContainerRegistryData(AzureLocation location, ContainerRegistrySku sku) : /// Whether to allow trusted Azure services to access a network restricted registry. /// Whether or not zone redundancy is enabled for this container registry. /// Enables registry-wide pull from unauthenticated clients. + /// Determines whether registry artifacts are indexed for metadata search. + /// Determines the domain name label reuse scope. + /// Determines registry role assignment mode. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerRegistrySku sku, ManagedServiceIdentity identity, string loginServer, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, IReadOnlyList dataEndpointHostNames, IReadOnlyList privateEndpointConnections, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, ContainerRegistryZoneRedundancy? zoneRedundancy, bool? isAnonymousPullEnabled, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ContainerRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerRegistrySku sku, ManagedServiceIdentity identity, string loginServer, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, IReadOnlyList dataEndpointHostNames, IReadOnlyList privateEndpointConnections, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, ContainerRegistryZoneRedundancy? zoneRedundancy, bool? isAnonymousPullEnabled, ContainerRegistryMetadataSearch? metadataSearch, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, ContainerRegistryRoleAssignmentMode? roleAssignmentMode, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Identity = identity; @@ -108,6 +111,9 @@ internal ContainerRegistryData(ResourceIdentifier id, string name, ResourceType NetworkRuleBypassOptions = networkRuleBypassOptions; ZoneRedundancy = zoneRedundancy; IsAnonymousPullEnabled = isAnonymousPullEnabled; + MetadataSearch = metadataSearch; + AutoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; + RoleAssignmentMode = roleAssignmentMode; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -167,5 +173,14 @@ internal ContainerRegistryData() /// Enables registry-wide pull from unauthenticated clients. [WirePath("properties.anonymousPullEnabled")] public bool? IsAnonymousPullEnabled { get; set; } + /// Determines whether registry artifacts are indexed for metadata search. + [WirePath("properties.metadataSearch")] + public ContainerRegistryMetadataSearch? MetadataSearch { get; set; } + /// Determines the domain name label reuse scope. + [WirePath("properties.autoGeneratedDomainNameLabelScope")] + public AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get; set; } + /// Determines registry role assignment mode. + [WirePath("properties.roleAssignmentMode")] + public ContainerRegistryRoleAssignmentMode? RoleAssignmentMode { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineCollection.cs new file mode 100644 index 000000000000..a46120fc3fa9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryExportPipelines method from an instance of . + /// + public partial class ContainerRegistryExportPipelineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryExportPipelineExportPipelinesClientDiagnostics; + private readonly ExportPipelinesRestOperations _containerRegistryExportPipelineExportPipelinesRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryExportPipelineCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerRegistryExportPipelineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryExportPipelineExportPipelinesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryExportPipelineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryExportPipelineResource.ResourceType, out string containerRegistryExportPipelineExportPipelinesApiVersion); + _containerRegistryExportPipelineExportPipelinesRestClient = new ExportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryExportPipelineExportPipelinesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates an export pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the export pipeline. + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string exportPipelineName, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryExportPipelineOperationSource(Client), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an export pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the export pipeline. + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string exportPipelineName, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryExportPipelineOperationSource(Client), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all export pipelines for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines + /// + /// + /// Operation Id + /// ExportPipelines_List + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryExportPipelineExportPipelinesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryExportPipelineExportPipelinesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryExportPipelineResource(Client, ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(e)), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, "ContainerRegistryExportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all export pipelines for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines + /// + /// + /// Operation Id + /// ExportPipelines_List + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryExportPipelineExportPipelinesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryExportPipelineExportPipelinesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryExportPipelineResource(Client, ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(e)), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, "ContainerRegistryExportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.Serialization.cs new file mode 100644 index 000000000000..c0625cd3e408 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.Serialization.cs @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryExportPipelineData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryExportPipelineData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteObjectValue(Target, options); + } + if (Optional.IsCollectionDefined(Options)) + { + writer.WritePropertyName("options"u8); + writer.WriteStartArray(); + foreach (var item in Options) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + ContainerRegistryExportPipelineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryExportPipelineData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryExportPipelineData(document.RootElement, options); + } + + internal static ContainerRegistryExportPipelineData DeserializeContainerRegistryExportPipelineData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureLocation? location = default; + ManagedServiceIdentity identity = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ExportPipelineTargetProperties target = default; + IList options0 = default; + ContainerRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("target"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + target = ExportPipelineTargetProperties.DeserializeExportPipelineTargetProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("options"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new ContainerRegistryPipelineOption(item.GetString())); + } + options0 = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryExportPipelineData( + id, + name, + type, + systemData, + location, + identity, + target, + options0 ?? new ChangeTrackingList(), + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Location)) + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + BicepSerializationHelpers.AppendChildObject(builder, Target, options, 4, false, " target: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" options: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Options)) + { + if (Options.Any()) + { + builder.Append(" options: "); + builder.AppendLine("["); + foreach (var item in Options) + { + builder.AppendLine($" '{item.ToString()}'"); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryExportPipelineData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryExportPipelineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerRegistryExportPipelineData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryExportPipelineData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.cs new file mode 100644 index 000000000000..4c094a6d3552 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryExportPipeline data model. + /// An object that represents an export pipeline for a container registry. + /// + public partial class ContainerRegistryExportPipelineData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryExportPipelineData() + { + Options = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The location of the export pipeline. + /// The identity of the export pipeline. + /// The target properties of the export pipeline. + /// The list of all options configured for the pipeline. + /// The provisioning state of the pipeline at the time the operation was called. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryExportPipelineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, ManagedServiceIdentity identity, ExportPipelineTargetProperties target, IList options, ContainerRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Location = location; + Identity = identity; + Target = target; + Options = options; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The location of the export pipeline. + [WirePath("location")] + public AzureLocation? Location { get; set; } + /// The identity of the export pipeline. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } + /// The target properties of the export pipeline. + [WirePath("properties.target")] + public ExportPipelineTargetProperties Target { get; set; } + /// The list of all options configured for the pipeline. + [WirePath("properties.options")] + public IList Options { get; } + /// The provisioning state of the pipeline at the time the operation was called. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.Serialization.cs new file mode 100644 index 000000000000..1da9c31065d2 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryExportPipelineResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryExportPipelineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerContainerRegistryContext.Default); + + ContainerRegistryExportPipelineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerContainerRegistryContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs new file mode 100644 index 000000000000..3f44d5d1c916 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryExportPipeline along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryExportPipelineResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryExportPipeline method. + /// + public partial class ContainerRegistryExportPipelineResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The exportPipelineName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryExportPipelineExportPipelinesClientDiagnostics; + private readonly ExportPipelinesRestOperations _containerRegistryExportPipelineExportPipelinesRestClient; + private readonly ContainerRegistryExportPipelineData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/exportPipelines"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryExportPipelineResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryExportPipelineResource(ArmClient client, ContainerRegistryExportPipelineData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryExportPipelineResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryExportPipelineExportPipelinesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryExportPipelineExportPipelinesApiVersion); + _containerRegistryExportPipelineExportPipelinesRestClient = new ExportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryExportPipelineExportPipelinesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryExportPipelineData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an export pipeline from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Delete + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an export pipeline from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Delete + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an export pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryExportPipelineOperationSource(Client), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an export pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryExportPipelineOperationSource(Client), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineCollection.cs new file mode 100644 index 000000000000..ec84168ef3b6 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryImportPipelines method from an instance of . + /// + public partial class ContainerRegistryImportPipelineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryImportPipelineImportPipelinesClientDiagnostics; + private readonly ImportPipelinesRestOperations _containerRegistryImportPipelineImportPipelinesRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryImportPipelineCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerRegistryImportPipelineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryImportPipelineImportPipelinesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryImportPipelineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryImportPipelineResource.ResourceType, out string containerRegistryImportPipelineImportPipelinesApiVersion); + _containerRegistryImportPipelineImportPipelinesRestClient = new ImportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryImportPipelineImportPipelinesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates an import pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the import pipeline. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string importPipelineName, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryImportPipelineOperationSource(Client), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an import pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the import pipeline. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string importPipelineName, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryImportPipelineOperationSource(Client), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all import pipelines for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines + /// + /// + /// Operation Id + /// ImportPipelines_List + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryImportPipelineImportPipelinesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryImportPipelineImportPipelinesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryImportPipelineResource(Client, ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(e)), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, "ContainerRegistryImportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all import pipelines for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines + /// + /// + /// Operation Id + /// ImportPipelines_List + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryImportPipelineImportPipelinesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryImportPipelineImportPipelinesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryImportPipelineResource(Client, ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(e)), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, "ContainerRegistryImportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.Serialization.cs new file mode 100644 index 000000000000..2dd874d88e21 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.Serialization.cs @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryImportPipelineData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryImportPipelineData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + } + if (Optional.IsDefined(Trigger)) + { + writer.WritePropertyName("trigger"u8); + writer.WriteObjectValue(Trigger, options); + } + if (Optional.IsCollectionDefined(Options)) + { + writer.WritePropertyName("options"u8); + writer.WriteStartArray(); + foreach (var item in Options) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + ContainerRegistryImportPipelineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryImportPipelineData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryImportPipelineData(document.RootElement, options); + } + + internal static ContainerRegistryImportPipelineData DeserializeContainerRegistryImportPipelineData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureLocation? location = default; + ManagedServiceIdentity identity = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ImportPipelineSourceProperties source = default; + PipelineTriggerProperties trigger = default; + IList options0 = default; + ContainerRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("source"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = ImportPipelineSourceProperties.DeserializeImportPipelineSourceProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("trigger"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trigger = PipelineTriggerProperties.DeserializePipelineTriggerProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("options"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new ContainerRegistryPipelineOption(item.GetString())); + } + options0 = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryImportPipelineData( + id, + name, + type, + systemData, + location, + identity, + source, + trigger, + options0 ?? new ChangeTrackingList(), + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Location)) + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 4, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceTriggerStatus", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" trigger: "); + builder.AppendLine("{"); + builder.AppendLine(" trigger: {"); + builder.AppendLine(" sourceTrigger: {"); + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Trigger)) + { + builder.Append(" trigger: "); + BicepSerializationHelpers.AppendChildObject(builder, Trigger, options, 4, false, " trigger: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" options: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Options)) + { + if (Options.Any()) + { + builder.Append(" options: "); + builder.AppendLine("["); + foreach (var item in Options) + { + builder.AppendLine($" '{item.ToString()}'"); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryImportPipelineData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryImportPipelineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerRegistryImportPipelineData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryImportPipelineData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.cs new file mode 100644 index 000000000000..db2239a31c7a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryImportPipeline data model. + /// An object that represents an import pipeline for a container registry. + /// + public partial class ContainerRegistryImportPipelineData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryImportPipelineData() + { + Options = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The location of the import pipeline. + /// The identity of the import pipeline. + /// The source properties of the import pipeline. + /// The properties that describe the trigger of the import pipeline. + /// The list of all options configured for the pipeline. + /// The provisioning state of the pipeline at the time the operation was called. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryImportPipelineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, ManagedServiceIdentity identity, ImportPipelineSourceProperties source, PipelineTriggerProperties trigger, IList options, ContainerRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Location = location; + Identity = identity; + Source = source; + Trigger = trigger; + Options = options; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The location of the import pipeline. + [WirePath("location")] + public AzureLocation? Location { get; set; } + /// The identity of the import pipeline. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } + /// The source properties of the import pipeline. + [WirePath("properties.source")] + public ImportPipelineSourceProperties Source { get; set; } + /// The properties that describe the trigger of the import pipeline. + internal PipelineTriggerProperties Trigger { get; set; } + /// The current status of the source trigger. + [WirePath("properties.trigger.sourceTrigger.status")] + public ContainerRegistryTriggerStatus? SourceTriggerStatus + { + get => Trigger is null ? default : Trigger.SourceTriggerStatus; + set + { + if (value.HasValue) + { + if (Trigger is null) + Trigger = new PipelineTriggerProperties(); + Trigger.SourceTriggerStatus = value.Value; + } + else + { + Trigger = null; + } + } + } + + /// The list of all options configured for the pipeline. + [WirePath("properties.options")] + public IList Options { get; } + /// The provisioning state of the pipeline at the time the operation was called. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.Serialization.cs new file mode 100644 index 000000000000..99e97b6ab248 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryImportPipelineResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryImportPipelineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerContainerRegistryContext.Default); + + ContainerRegistryImportPipelineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerContainerRegistryContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.cs new file mode 100644 index 000000000000..c1f3c343d8d5 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryImportPipeline along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryImportPipelineResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryImportPipeline method. + /// + public partial class ContainerRegistryImportPipelineResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The importPipelineName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryImportPipelineImportPipelinesClientDiagnostics; + private readonly ImportPipelinesRestOperations _containerRegistryImportPipelineImportPipelinesRestClient; + private readonly ContainerRegistryImportPipelineData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/importPipelines"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryImportPipelineResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryImportPipelineResource(ArmClient client, ContainerRegistryImportPipelineData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryImportPipelineResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryImportPipelineImportPipelinesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryImportPipelineImportPipelinesApiVersion); + _containerRegistryImportPipelineImportPipelinesRestClient = new ImportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryImportPipelineImportPipelinesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryImportPipelineData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an import pipeline from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Delete + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an import pipeline from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Delete + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an import pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryImportPipelineOperationSource(Client), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an import pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryImportPipelineOperationSource(Client), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs new file mode 100644 index 000000000000..08dd71975a02 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryPipelineRuns method from an instance of . + /// + public partial class ContainerRegistryPipelineRunCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryPipelineRunPipelineRunsClientDiagnostics; + private readonly PipelineRunsRestOperations _containerRegistryPipelineRunPipelineRunsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryPipelineRunCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerRegistryPipelineRunCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryPipelineRunPipelineRunsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryPipelineRunResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryPipelineRunResource.ResourceType, out string containerRegistryPipelineRunPipelineRunsApiVersion); + _containerRegistryPipelineRunPipelineRunsRestClient = new PipelineRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryPipelineRunPipelineRunsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates a pipeline run for a container registry with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the pipeline run. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a pipeline run for a container registry with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the pipeline run. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the pipeline runs for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns + /// + /// + /// Operation Id + /// PipelineRuns_List + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryPipelineRunResource(Client, ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(e)), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, "ContainerRegistryPipelineRunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the pipeline runs for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns + /// + /// + /// Operation Id + /// PipelineRuns_List + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryPipelineRunResource(Client, ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(e)), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, "ContainerRegistryPipelineRunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.Serialization.cs new file mode 100644 index 000000000000..99aea269cffe --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.Serialization.cs @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryPipelineRunData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(Request)) + { + writer.WritePropertyName("request"u8); + writer.WriteObjectValue(Request, options); + } + if (options.Format != "W" && Optional.IsDefined(Response)) + { + writer.WritePropertyName("response"u8); + writer.WriteObjectValue(Response, options); + } + if (Optional.IsDefined(ForceUpdateTag)) + { + writer.WritePropertyName("forceUpdateTag"u8); + writer.WriteStringValue(ForceUpdateTag); + } + writer.WriteEndObject(); + } + + ContainerRegistryPipelineRunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryPipelineRunData(document.RootElement, options); + } + + internal static ContainerRegistryPipelineRunData DeserializeContainerRegistryPipelineRunData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ContainerRegistryProvisioningState? provisioningState = default; + ConnectedRegistryPipelineRunContent request = default; + PipelineRunResult response = default; + string forceUpdateTag = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("request"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + request = ConnectedRegistryPipelineRunContent.DeserializeConnectedRegistryPipelineRunContent(property0.Value, options); + continue; + } + if (property0.NameEquals("response"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + response = PipelineRunResult.DeserializePipelineRunResult(property0.Value, options); + continue; + } + if (property0.NameEquals("forceUpdateTag"u8)) + { + forceUpdateTag = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryPipelineRunData( + id, + name, + type, + systemData, + provisioningState, + request, + response, + forceUpdateTag, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Request), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" request: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Request)) + { + builder.Append(" request: "); + BicepSerializationHelpers.AppendChildObject(builder, Request, options, 4, false, " request: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Response), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" response: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Response)) + { + builder.Append(" response: "); + BicepSerializationHelpers.AppendChildObject(builder, Response, options, 4, false, " response: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ForceUpdateTag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" forceUpdateTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ForceUpdateTag)) + { + builder.Append(" forceUpdateTag: "); + if (ForceUpdateTag.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ForceUpdateTag}'''"); + } + else + { + builder.AppendLine($"'{ForceUpdateTag}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryPipelineRunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerRegistryPipelineRunData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.cs new file mode 100644 index 000000000000..54c3f395a8d9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryPipelineRun data model. + /// An object that represents a pipeline run for a container registry. + /// + public partial class ContainerRegistryPipelineRunData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryPipelineRunData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of a pipeline run. + /// The request parameters for a pipeline run. + /// The response of a pipeline run. + /// How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryPipelineRunData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerRegistryProvisioningState? provisioningState, ConnectedRegistryPipelineRunContent request, PipelineRunResult response, string forceUpdateTag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + Request = request; + Response = response; + ForceUpdateTag = forceUpdateTag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioning state of a pipeline run. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + /// The request parameters for a pipeline run. + [WirePath("properties.request")] + public ConnectedRegistryPipelineRunContent Request { get; set; } + /// The response of a pipeline run. + [WirePath("properties.response")] + public PipelineRunResult Response { get; } + /// How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. + [WirePath("properties.forceUpdateTag")] + public string ForceUpdateTag { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.Serialization.cs new file mode 100644 index 000000000000..035c4bcac768 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryPipelineRunResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryPipelineRunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerContainerRegistryContext.Default); + + ContainerRegistryPipelineRunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerContainerRegistryContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs new file mode 100644 index 000000000000..2b5da03cc785 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryPipelineRun along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryPipelineRunResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryPipelineRun method. + /// + public partial class ContainerRegistryPipelineRunResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The pipelineRunName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryPipelineRunPipelineRunsClientDiagnostics; + private readonly PipelineRunsRestOperations _containerRegistryPipelineRunPipelineRunsRestClient; + private readonly ContainerRegistryPipelineRunData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/pipelineRuns"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryPipelineRunResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryPipelineRunResource(ArmClient client, ContainerRegistryPipelineRunData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryPipelineRunResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryPipelineRunPipelineRunsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryPipelineRunPipelineRunsApiVersion); + _containerRegistryPipelineRunPipelineRunsRestClient = new PipelineRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryPipelineRunPipelineRunsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryPipelineRunData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a pipeline run from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Delete + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a pipeline run from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Delete + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a pipeline run for a container registry with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a pipeline run for a container registry with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Create + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs index 7f63a61eb6f9..55828d82ede6 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get( /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetA /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs index 75bcbac5f805..864d25f87f08 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get( /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs index a3f1751b60b2..24c9d46c2ca6 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs index 9028c36e88df..6f6395b57a35 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupNa /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs index 09d6834f91ae..b75196bec21f 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string replica /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string replicationName, Ca /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string replicationName, CancellationToken c /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs index 73a0703a0904..e7d66037e4e7 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUnt /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTag /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTag /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs index a6cfcf1c5130..c5af2a6ace52 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs @@ -99,6 +99,80 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of ContainerRegistryArchiveResources in the ContainerRegistry. + /// The type of the package resource. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of ContainerRegistryArchiveResources and their operations over a ContainerRegistryArchiveResource. + public virtual ContainerRegistryArchiveCollection GetContainerRegistryArchives(string packageType) + { + return new ContainerRegistryArchiveCollection(Client, Id, packageType); + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryArchiveAsync(string packageType, string archiveName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryArchives(packageType).GetAsync(archiveName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryArchive(string packageType, string archiveName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryArchives(packageType).Get(archiveName, cancellationToken); + } + /// Gets a collection of ContainerRegistryCacheRuleResources in the ContainerRegistry. /// An object representing collection of ContainerRegistryCacheRuleResources and their operations over a ContainerRegistryCacheRuleResource. public virtual ContainerRegistryCacheRuleCollection GetContainerRegistryCacheRules() @@ -119,7 +193,7 @@ public virtual ContainerRegistryCacheRuleCollection GetContainerRegistryCacheRul /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -150,7 +224,7 @@ public virtual async Task> GetConta /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -188,7 +262,7 @@ public virtual ConnectedRegistryCollection GetConnectedRegistries() /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -219,7 +293,7 @@ public virtual async Task> GetConnectedRegis /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -257,7 +331,7 @@ public virtual ContainerRegistryCredentialSetCollection GetContainerRegistryCred /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -288,7 +362,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -306,6 +380,75 @@ public virtual Response GetContainerRegi return GetContainerRegistryCredentialSets().Get(credentialSetName, cancellationToken); } + /// Gets a collection of ContainerRegistryExportPipelineResources in the ContainerRegistry. + /// An object representing collection of ContainerRegistryExportPipelineResources and their operations over a ContainerRegistryExportPipelineResource. + public virtual ContainerRegistryExportPipelineCollection GetContainerRegistryExportPipelines() + { + return GetCachedClient(client => new ContainerRegistryExportPipelineCollection(client, Id)); + } + + /// + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryExportPipelineAsync(string exportPipelineName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryExportPipelines().GetAsync(exportPipelineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryExportPipeline(string exportPipelineName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryExportPipelines().Get(exportPipelineName, cancellationToken); + } + /// Gets a collection of ContainerRegistryPrivateLinkResources in the ContainerRegistry. /// An object representing collection of ContainerRegistryPrivateLinkResources and their operations over a ContainerRegistryPrivateLinkResource. public virtual ContainerRegistryPrivateLinkResourceCollection GetContainerRegistryPrivateLinkResources() @@ -326,7 +469,7 @@ public virtual ContainerRegistryPrivateLinkResourceCollection GetContainerRegist /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -357,7 +500,7 @@ public virtual async Task> GetCon /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -375,6 +518,144 @@ public virtual Response GetContainerRegist return GetContainerRegistryPrivateLinkResources().Get(groupName, cancellationToken); } + /// Gets a collection of ContainerRegistryImportPipelineResources in the ContainerRegistry. + /// An object representing collection of ContainerRegistryImportPipelineResources and their operations over a ContainerRegistryImportPipelineResource. + public virtual ContainerRegistryImportPipelineCollection GetContainerRegistryImportPipelines() + { + return GetCachedClient(client => new ContainerRegistryImportPipelineCollection(client, Id)); + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryImportPipelineAsync(string importPipelineName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryImportPipelines().GetAsync(importPipelineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryImportPipeline(string importPipelineName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryImportPipelines().Get(importPipelineName, cancellationToken); + } + + /// Gets a collection of ContainerRegistryPipelineRunResources in the ContainerRegistry. + /// An object representing collection of ContainerRegistryPipelineRunResources and their operations over a ContainerRegistryPipelineRunResource. + public virtual ContainerRegistryPipelineRunCollection GetContainerRegistryPipelineRuns() + { + return GetCachedClient(client => new ContainerRegistryPipelineRunCollection(client, Id)); + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryPipelineRunAsync(string pipelineRunName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryPipelineRuns().GetAsync(pipelineRunName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2025-06-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryPipelineRun(string pipelineRunName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryPipelineRuns().Get(pipelineRunName, cancellationToken); + } + /// Gets a collection of ContainerRegistryPrivateEndpointConnectionResources in the ContainerRegistry. /// An object representing collection of ContainerRegistryPrivateEndpointConnectionResources and their operations over a ContainerRegistryPrivateEndpointConnectionResource. public virtual ContainerRegistryPrivateEndpointConnectionCollection GetContainerRegistryPrivateEndpointConnections() @@ -395,7 +676,7 @@ public virtual ContainerRegistryPrivateEndpointConnectionCollection GetContainer /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -426,7 +707,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -464,7 +745,7 @@ public virtual ContainerRegistryReplicationCollection GetContainerRegistryReplic /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -495,7 +776,7 @@ public virtual async Task> GetCon /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -533,7 +814,7 @@ public virtual ScopeMapCollection GetScopeMaps() /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -564,7 +845,7 @@ public virtual async Task> GetScopeMapAsync(string sc /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -602,7 +883,7 @@ public virtual ContainerRegistryTokenCollection GetContainerRegistryTokens() /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -633,7 +914,7 @@ public virtual async Task> GetContainer /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -671,7 +952,7 @@ public virtual ContainerRegistryWebhookCollection GetContainerRegistryWebhooks() /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -702,7 +983,7 @@ public virtual async Task> GetContain /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -740,7 +1021,7 @@ public virtual ContainerRegistryAgentPoolCollection GetContainerRegistryAgentPoo /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -771,7 +1052,7 @@ public virtual async Task> GetConta /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -809,7 +1090,7 @@ public virtual ContainerRegistryRunCollection GetContainerRegistryRuns() /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -840,7 +1121,7 @@ public virtual async Task> GetContainerRe /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -878,7 +1159,7 @@ public virtual ContainerRegistryTaskRunCollection GetContainerRegistryTaskRuns() /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -909,7 +1190,7 @@ public virtual async Task> GetContain /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -947,7 +1228,7 @@ public virtual ContainerRegistryTaskCollection GetContainerRegistryTasks() /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -978,7 +1259,7 @@ public virtual async Task> GetContainerR /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -1009,7 +1290,7 @@ public virtual Response GetContainerRegistryTask( /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1049,7 +1330,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1089,7 +1370,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1131,7 +1412,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1173,7 +1454,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1219,7 +1500,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1265,7 +1546,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1311,7 +1592,7 @@ public virtual async Task ImportImageAsync(WaitUntil waitUntil, Co /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1357,7 +1638,7 @@ public virtual ArmOperation ImportImage(WaitUntil waitUntil, ContainerRegistryIm /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1386,7 +1667,7 @@ public virtual AsyncPageable GetUsagesAsync(Cancellation /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1415,7 +1696,7 @@ public virtual Pageable GetUsages(CancellationToken canc /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1453,7 +1734,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1491,7 +1772,7 @@ public virtual Response GetCredentials(C /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1533,7 +1814,7 @@ public virtual async Task> Rege /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1575,7 +1856,7 @@ public virtual Response RegenerateCreden /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1621,7 +1902,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1667,15 +1948,14 @@ public virtual ArmOperation Generate /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The parameters of a run that needs to scheduled. /// The cancellation token to use. /// is null. - public virtual async Task> ScheduleRunAsync(WaitUntil waitUntil, ContainerRegistryRunContent content, CancellationToken cancellationToken = default) + public virtual async Task> ScheduleRunAsync(ContainerRegistryRunContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); @@ -1684,10 +1964,7 @@ public virtual async Task> ScheduleRu try { var response = await _schedulesRestClient.ScheduleRunAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _schedulesClientDiagnostics, Pipeline, _schedulesRestClient.CreateScheduleRunRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; + return Response.FromValue(new ContainerRegistryRunResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -1709,15 +1986,14 @@ public virtual async Task> ScheduleRu /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The parameters of a run that needs to scheduled. /// The cancellation token to use. /// is null. - public virtual ArmOperation ScheduleRun(WaitUntil waitUntil, ContainerRegistryRunContent content, CancellationToken cancellationToken = default) + public virtual Response ScheduleRun(ContainerRegistryRunContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); @@ -1726,10 +2002,7 @@ public virtual ArmOperation ScheduleRun(WaitUntil try { var response = _schedulesRestClient.ScheduleRun(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _schedulesClientDiagnostics, Pipeline, _schedulesRestClient.CreateScheduleRunRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; + return Response.FromValue(new ContainerRegistryRunResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -1751,7 +2024,7 @@ public virtual ArmOperation ScheduleRun(WaitUntil /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// @@ -1785,7 +2058,7 @@ public virtual async Task> GetBuildSourceUpload /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// @@ -1819,7 +2092,7 @@ public virtual Response GetBuildSourceUploadUrl(Cancella /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1881,7 +2154,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -1943,7 +2216,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -2000,7 +2273,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -2057,7 +2330,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -2117,7 +2390,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunCollection.cs index b517765dba19..02971f5b754a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string runId, Cancella /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -186,7 +186,7 @@ public virtual AsyncPageable GetAllAsync(string fi /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -218,7 +218,7 @@ public virtual Pageable GetAll(string filter = nul /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -261,7 +261,7 @@ public virtual async Task> ExistsAsync(string runId, Cancellation /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -304,7 +304,7 @@ public virtual Response Exists(string runId, CancellationToken cancellatio /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunResource.cs index 5317e7ba7596..2d0de1093b9e 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -190,11 +190,10 @@ public virtual Response Get(CancellationToken canc /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The run update properties. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -203,10 +202,7 @@ public virtual async Task> UpdateAsyn try { var response = await _containerRegistryRunRunsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; + return Response.FromValue(new ContainerRegistryRunResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -228,7 +224,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -236,11 +232,10 @@ public virtual async Task> UpdateAsyn /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The run update properties. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) + public virtual Response Update(ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -249,10 +244,7 @@ public virtual ArmOperation Update(WaitUntil waitU try { var response = _containerRegistryRunRunsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; + return Response.FromValue(new ContainerRegistryRunResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -274,7 +266,7 @@ public virtual ArmOperation Update(WaitUntil waitU /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +304,7 @@ public virtual async Task> GetLogSasU /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -350,7 +342,7 @@ public virtual Response GetLogSasUrl(Cancellat /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -358,19 +350,15 @@ public virtual Response GetLogSasUrl(Cancellat /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual async Task CancelAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task CancelAsync(CancellationToken cancellationToken = default) { using var scope = _containerRegistryRunRunsClientDiagnostics.CreateScope("ContainerRegistryRunResource.Cancel"); scope.Start(); try { var response = await _containerRegistryRunRunsRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateCancelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; + return response; } catch (Exception e) { @@ -392,7 +380,7 @@ public virtual async Task CancelAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -400,19 +388,15 @@ public virtual async Task CancelAsync(WaitUntil waitUntil, Cancell /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual ArmOperation Cancel(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual Response Cancel(CancellationToken cancellationToken = default) { using var scope = _containerRegistryRunRunsClientDiagnostics.CreateScope("ContainerRegistryRunResource.Cancel"); scope.Start(); try { var response = _containerRegistryRunRunsRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateCancelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; + return response; } catch (Exception e) { diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskCollection.cs index 82f52bd3f6cd..4132933ade32 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -88,7 +88,9 @@ public virtual async Task> CreateOrU try { var response = await _containerRegistryTaskTasksRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, data).Request, response, OperationFinalStateVia.Location); + var uri = _containerRegistryTaskTasksRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerRegistryArmOperation(Response.FromValue(new ContainerRegistryTaskResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -113,7 +115,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -137,7 +139,9 @@ public virtual ArmOperation CreateOrUpdate(WaitUn try { var response = _containerRegistryTaskTasksRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, data).Request, response, OperationFinalStateVia.Location); + var uri = _containerRegistryTaskTasksRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerRegistryArmOperation(Response.FromValue(new ContainerRegistryTaskResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -162,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -207,7 +211,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -252,7 +256,7 @@ public virtual Response Get(string taskName, Canc /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -282,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -355,7 +359,7 @@ public virtual async Task> ExistsAsync(string taskName, Cancellat /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -398,7 +402,7 @@ public virtual Response Exists(string taskName, CancellationToken cancella /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -443,7 +447,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskResource.cs index 2d506292885e..da92c2f2b17a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -200,7 +200,9 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _containerRegistryTaskTasksRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var uri = _containerRegistryTaskTasksRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerRegistryArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -225,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -242,7 +244,9 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _containerRegistryTaskTasksRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var uri = _containerRegistryTaskTasksRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerRegistryArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -267,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -275,11 +279,10 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The parameters for updating a task. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -288,10 +291,7 @@ public virtual async Task> UpdateAsy try { var response = await _containerRegistryTaskTasksRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; + return Response.FromValue(new ContainerRegistryTaskResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -321,11 +321,10 @@ public virtual async Task> UpdateAsy /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The parameters for updating a task. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) + public virtual Response Update(ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -334,10 +333,7 @@ public virtual ArmOperation Update(WaitUntil wait try { var response = _containerRegistryTaskTasksRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; + return Response.FromValue(new ContainerRegistryTaskResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -359,7 +355,7 @@ public virtual ArmOperation Update(WaitUntil wait /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -397,7 +393,7 @@ public virtual async Task> GetDetailsAsy /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -435,7 +431,7 @@ public virtual Response GetDetails(CancellationTo /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -473,8 +469,8 @@ public virtual async Task> AddTagAsync(s patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; } } catch (Exception e) @@ -497,7 +493,7 @@ public virtual async Task> AddTagAsync(s /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -535,8 +531,8 @@ public virtual Response AddTag(string key, string patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); + var result = Update(patch, cancellationToken: cancellationToken); + return result; } } catch (Exception e) @@ -559,7 +555,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -592,8 +588,8 @@ public virtual async Task> SetTagsAsync( var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; var patch = new ContainerRegistryTaskPatch(); patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; } } catch (Exception e) @@ -616,7 +612,7 @@ public virtual async Task> SetTagsAsync( /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -649,8 +645,8 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -709,8 +705,8 @@ public virtual async Task> RemoveTagAsyn patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; } } catch (Exception e) @@ -733,7 +729,7 @@ public virtual async Task> RemoveTagAsyn /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -769,8 +765,8 @@ public virtual Response RemoveTag(string key, Can patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); + var result = Update(patch, cancellationToken: cancellationToken); + return result; } } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunCollection.cs index ea6cddc68421..921e6dfe5022 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -88,7 +88,7 @@ public virtual async Task> Create try { var response = await _containerRegistryTaskRunTaskRunsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, data).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -113,7 +113,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -137,7 +137,7 @@ public virtual ArmOperation CreateOrUpdate(Wai try { var response = _containerRegistryTaskRunTaskRunsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, data).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string taskRunName /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string taskRunName, Cancel /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string taskRunName, CancellationToken cance /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunResource.cs index b27b49f463a5..8b4697de1363 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -199,7 +199,9 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _containerRegistryTaskRunTaskRunsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var uri = _containerRegistryTaskRunTaskRunsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerRegistryArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -224,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -241,7 +243,9 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _containerRegistryTaskRunTaskRunsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var uri = _containerRegistryTaskRunTaskRunsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerRegistryArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -266,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -287,7 +291,7 @@ public virtual async Task> Update try { var response = await _containerRegistryTaskRunTaskRunsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -312,7 +316,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -333,7 +337,7 @@ public virtual ArmOperation Update(WaitUntil w try { var response = _containerRegistryTaskRunTaskRunsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -358,7 +362,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource @@ -396,7 +400,7 @@ public virtual async Task> GetDetails /// /// /// Default Api Version - /// 2019-06-01-preview + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs index 1d4488d63c10..aa2b7c47b9dd 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string tokenName, Ca /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string tokenName, Cancella /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string tokenName, CancellationToken cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs index b74b1f10b7b1..2b4a46789213 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs index 3e3d00a77815..5692dc478e32 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string webhookName /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string webhookName, Cancel /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string webhookName, CancellationToken cance /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs index 65063da4a9e8..8f45eeeb6253 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual async Task> PingAsync /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -436,7 +436,7 @@ public virtual Response Ping(CancellationToke /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -466,7 +466,7 @@ public virtual AsyncPageable GetEventsAsync(Cance /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -496,7 +496,7 @@ public virtual Pageable GetEvents(CancellationTok /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -534,7 +534,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -572,7 +572,7 @@ public virtual Response GetCallbackConfi /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -634,7 +634,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -696,7 +696,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -753,7 +753,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -810,7 +810,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -870,7 +870,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs index 719ccf0d88b1..a462eae59c7d 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs @@ -33,6 +33,44 @@ private static MockableContainerRegistrySubscriptionResource GetMockableContaine return resource.GetCachedClient(client => new MockableContainerRegistrySubscriptionResource(client, resource.Id)); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryArchiveResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryArchiveVersionResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -90,6 +128,25 @@ public static ContainerRegistryCredentialSetResource GetContainerRegistryCredent return GetMockableContainerRegistryArmClient(client).GetContainerRegistryCredentialSetResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryExportPipelineResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -128,6 +185,44 @@ public static ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLi return GetMockableContainerRegistryArmClient(client).GetContainerRegistryPrivateLinkResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryImportPipelineResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryPipelineRunResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -329,7 +424,7 @@ public static ContainerRegistryCollection GetContainerRegistries(this ResourceGr /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -367,7 +462,7 @@ public static async Task> GetContainerRegist /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -405,7 +500,7 @@ public static Response GetContainerRegistry(this Reso /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -441,7 +536,7 @@ public static async Task> CheckCo /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -477,7 +572,7 @@ public static Response CheckContainerRegis /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -513,7 +608,7 @@ public static AsyncPageable GetContainerRegistriesAsy /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryArmClient.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryArmClient.cs index 37abbc0770c9..fdad1f69cc73 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryArmClient.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryArmClient.cs @@ -34,6 +34,30 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(ResourceIdentifier id) + { + ContainerRegistryArchiveResource.ValidateResourceId(id); + return new ContainerRegistryArchiveResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(ResourceIdentifier id) + { + ContainerRegistryArchiveVersionResource.ValidateResourceId(id); + return new ContainerRegistryArchiveVersionResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -70,6 +94,18 @@ public virtual ContainerRegistryCredentialSetResource GetContainerRegistryCreden return new ContainerRegistryCredentialSetResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(ResourceIdentifier id) + { + ContainerRegistryExportPipelineResource.ValidateResourceId(id); + return new ContainerRegistryExportPipelineResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -94,6 +130,30 @@ public virtual ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateL return new ContainerRegistryPrivateLinkResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(ResourceIdentifier id) + { + ContainerRegistryImportPipelineResource.ValidateResourceId(id); + return new ContainerRegistryImportPipelineResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(ResourceIdentifier id) + { + ContainerRegistryPipelineRunResource.ValidateResourceId(id); + return new ContainerRegistryPipelineRunResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryResourceGroupResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryResourceGroupResource.cs index a14a12a821af..1f4f24f2e6db 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryResourceGroupResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual ContainerRegistryCollection GetContainerRegistries() /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetContainerRegis /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistrySubscriptionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistrySubscriptionResource.cs index 6e23a83e85a0..a23d653b0654 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistrySubscriptionResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistrySubscriptionResource.cs @@ -55,7 +55,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -97,7 +97,7 @@ public virtual async Task> CheckC /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual Response CheckContainerRegi /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -169,7 +169,7 @@ public virtual AsyncPageable GetContainerRegistriesAs /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveOperationSource.cs new file mode 100644 index 000000000000..6d9de00996c2 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryArchiveOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryArchiveOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryArchiveResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); + return new ContainerRegistryArchiveResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); + return await Task.FromResult(new ContainerRegistryArchiveResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveVersionOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveVersionOperationSource.cs new file mode 100644 index 000000000000..acaf27fd261c --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveVersionOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryArchiveVersionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryArchiveVersionOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryArchiveVersionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); + return new ContainerRegistryArchiveVersionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); + return await Task.FromResult(new ContainerRegistryArchiveVersionResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryExportPipelineOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryExportPipelineOperationSource.cs new file mode 100644 index 000000000000..1b467d5c2e17 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryExportPipelineOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryExportPipelineOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryExportPipelineOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryExportPipelineResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); + return new ContainerRegistryExportPipelineResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); + return await Task.FromResult(new ContainerRegistryExportPipelineResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryImportPipelineOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryImportPipelineOperationSource.cs new file mode 100644 index 000000000000..a4a35b5795ff --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryImportPipelineOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryImportPipelineOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryImportPipelineOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryImportPipelineResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); + return new ContainerRegistryImportPipelineResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); + return await Task.FromResult(new ContainerRegistryImportPipelineResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs new file mode 100644 index 000000000000..f494cc905e12 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryPipelineRunOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryPipelineRunOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryPipelineRunResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); + return new ContainerRegistryPipelineRunResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); + return await Task.FromResult(new ContainerRegistryPipelineRunResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryRunOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryRunOperationSource.cs deleted file mode 100644 index 316599b8d4b9..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryRunOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry -{ - internal class ContainerRegistryRunOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ContainerRegistryRunOperationSource(ArmClient client) - { - _client = client; - } - - ContainerRegistryRunResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); - return new ContainerRegistryRunResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); - return await Task.FromResult(new ContainerRegistryRunResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryTaskOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryTaskOperationSource.cs deleted file mode 100644 index 4d4641891379..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryTaskOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry -{ - internal class ContainerRegistryTaskOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ContainerRegistryTaskOperationSource(ArmClient client) - { - _client = client; - } - - ContainerRegistryTaskResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); - return new ContainerRegistryTaskResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerContainerRegistryContext.Default); - return await Task.FromResult(new ContainerRegistryTaskResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs new file mode 100644 index 000000000000..3e2c9fab4d6a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class ArchiveListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchiveListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ArchiveListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchiveListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArchiveListResult(document.RootElement, options); + } + + internal static ArchiveListResult DeserializeArchiveListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ArchiveListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ArchiveListResult)} does not support writing '{options.Format}' format."); + } + } + + ArchiveListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeArchiveListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArchiveListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.cs new file mode 100644 index 000000000000..d55ed7fa5618 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list archives for a container registry. + internal partial class ArchiveListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ArchiveListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of archives. Since this list may be incomplete, the nextLink field should be used to request the next list of distributions. + /// The URI that can be used to request the next list of archives. + /// Keeps track of any properties unknown to the library. + internal ArchiveListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of archives. Since this list may be incomplete, the nextLink field should be used to request the next list of distributions. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of archives. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs new file mode 100644 index 000000000000..9d349e2647f6 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ArchivePackageSourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchivePackageSourceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SourceType.Value.ToString()); + } + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ArchivePackageSourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchivePackageSourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArchivePackageSourceProperties(document.RootElement, options); + } + + internal static ArchivePackageSourceProperties DeserializeArchivePackageSourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ArchivePackageSourceType? type = default; + Uri url = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ArchivePackageSourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("url"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + url = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ArchivePackageSourceProperties(type, url, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SourceType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{SourceType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" url: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Uri)) + { + builder.Append(" url: "); + builder.AppendLine($"'{Uri.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ArchivePackageSourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ArchivePackageSourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeArchivePackageSourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArchivePackageSourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.cs new file mode 100644 index 000000000000..6231b9e44a8f --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The properties of the archive package source. + public partial class ArchivePackageSourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ArchivePackageSourceProperties() + { + } + + /// Initializes a new instance of . + /// The type of package source for a archive. + /// The external repository url. + /// Keeps track of any properties unknown to the library. + internal ArchivePackageSourceProperties(ArchivePackageSourceType? sourceType, Uri uri, IDictionary serializedAdditionalRawData) + { + SourceType = sourceType; + Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of package source for a archive. + [WirePath("type")] + public ArchivePackageSourceType? SourceType { get; set; } + /// The external repository url. + [WirePath("url")] + public Uri Uri { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceType.cs new file mode 100644 index 000000000000..84c2208d063a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The type of package source for a archive. + public readonly partial struct ArchivePackageSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ArchivePackageSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RemoteValue = "remote"; + + /// remote. + public static ArchivePackageSourceType Remote { get; } = new ArchivePackageSourceType(RemoteValue); + /// Determines if two values are the same. + public static bool operator ==(ArchivePackageSourceType left, ArchivePackageSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ArchivePackageSourceType left, ArchivePackageSourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ArchivePackageSourceType(string value) => new ArchivePackageSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ArchivePackageSourceType other && Equals(other); + /// + public bool Equals(ArchivePackageSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.Serialization.cs new file mode 100644 index 000000000000..6ff7630fc3e0 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class ArchiveVersionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchiveVersionListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ArchiveVersionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchiveVersionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArchiveVersionListResult(document.RootElement, options); + } + + internal static ArchiveVersionListResult DeserializeArchiveVersionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ArchiveVersionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ArchiveVersionListResult)} does not support writing '{options.Format}' format."); + } + } + + ArchiveVersionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeArchiveVersionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArchiveVersionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.cs new file mode 100644 index 000000000000..6c6387c5265e --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list export pipelines for a container registry. + internal partial class ArchiveVersionListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ArchiveVersionListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. + /// The URI that can be used to request the next list of pipeline runs. + /// Keeps track of any properties unknown to the library. + internal ArchiveVersionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of pipeline runs. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs new file mode 100644 index 000000000000..4f6f0c364d12 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The auto generated domain name label of the container registry. This value defaults to "Unsecure". + public readonly partial struct AutoGeneratedDomainNameLabelScope : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoGeneratedDomainNameLabelScope(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnsecureValue = "Unsecure"; + private const string TenantReuseValue = "TenantReuse"; + private const string SubscriptionReuseValue = "SubscriptionReuse"; + private const string ResourceGroupReuseValue = "ResourceGroupReuse"; + private const string NoReuseValue = "NoReuse"; + + /// Unsecure. + public static AutoGeneratedDomainNameLabelScope Unsecure { get; } = new AutoGeneratedDomainNameLabelScope(UnsecureValue); + /// TenantReuse. + public static AutoGeneratedDomainNameLabelScope TenantReuse { get; } = new AutoGeneratedDomainNameLabelScope(TenantReuseValue); + /// SubscriptionReuse. + public static AutoGeneratedDomainNameLabelScope SubscriptionReuse { get; } = new AutoGeneratedDomainNameLabelScope(SubscriptionReuseValue); + /// ResourceGroupReuse. + public static AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get; } = new AutoGeneratedDomainNameLabelScope(ResourceGroupReuseValue); + /// NoReuse. + public static AutoGeneratedDomainNameLabelScope NoReuse { get; } = new AutoGeneratedDomainNameLabelScope(NoReuseValue); + /// Determines if two values are the same. + public static bool operator ==(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoGeneratedDomainNameLabelScope(string value) => new AutoGeneratedDomainNameLabelScope(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoGeneratedDomainNameLabelScope other && Equals(other); + /// + public bool Equals(AutoGeneratedDomainNameLabelScope other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs index b4146f220dcb..10a0dcc15443 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs @@ -43,7 +43,7 @@ internal partial class ConnectedRegistryActivation /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . internal ConnectedRegistryActivation() diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs index 30d117394bc5..d243f0fe0f42 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs @@ -54,7 +54,7 @@ public ConnectedRegistryPatch() } /// Initializes a new instance of . - /// The parameters for updating the sync properties of the connected registry with its parent. + /// The sync properties of the connected registry with its parent. /// The logging properties of the connected registry. /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. /// The list of notifications subscription information for the connected registry. @@ -70,7 +70,7 @@ internal ConnectedRegistryPatch(ConnectedRegistrySyncUpdateProperties syncProper _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The parameters for updating the sync properties of the connected registry with its parent. + /// The sync properties of the connected registry with its parent. [WirePath("properties.syncProperties")] public ConnectedRegistrySyncUpdateProperties SyncProperties { get; set; } /// The logging properties of the connected registry. diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.Serialization.cs new file mode 100644 index 000000000000..f4b00c3caab0 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.Serialization.cs @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ConnectedRegistryPipelineRunContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryPipelineRunContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PipelineResourceId)) + { + writer.WritePropertyName("pipelineResourceId"u8); + writer.WriteStringValue(PipelineResourceId); + } + if (Optional.IsCollectionDefined(Artifacts)) + { + writer.WritePropertyName("artifacts"u8); + writer.WriteStartArray(); + foreach (var item in Artifacts) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteObjectValue(Target, options); + } + if (Optional.IsDefined(CatalogDigest)) + { + writer.WritePropertyName("catalogDigest"u8); + writer.WriteStringValue(CatalogDigest); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistryPipelineRunContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryPipelineRunContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistryPipelineRunContent(document.RootElement, options); + } + + internal static ConnectedRegistryPipelineRunContent DeserializeConnectedRegistryPipelineRunContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier pipelineResourceId = default; + IList artifacts = default; + ContainerRegistryPipelineRunSourceProperties source = default; + ContainerRegistryPipelineRunTargetProperties target = default; + string catalogDigest = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pipelineResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pipelineResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("artifacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + artifacts = array; + continue; + } + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = ContainerRegistryPipelineRunSourceProperties.DeserializeContainerRegistryPipelineRunSourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("target"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + target = ContainerRegistryPipelineRunTargetProperties.DeserializeContainerRegistryPipelineRunTargetProperties(property.Value, options); + continue; + } + if (property.NameEquals("catalogDigest"u8)) + { + catalogDigest = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistryPipelineRunContent( + pipelineResourceId, + artifacts ?? new ChangeTrackingList(), + source, + target, + catalogDigest, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PipelineResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" pipelineResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PipelineResourceId)) + { + builder.Append(" pipelineResourceId: "); + builder.AppendLine($"'{PipelineResourceId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Artifacts), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" artifacts: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Artifacts)) + { + if (Artifacts.Any()) + { + builder.Append(" artifacts: "); + builder.AppendLine("["); + foreach (var item in Artifacts) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + BicepSerializationHelpers.AppendChildObject(builder, Target, options, 2, false, " target: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CatalogDigest), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" catalogDigest: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CatalogDigest)) + { + builder.Append(" catalogDigest: "); + if (CatalogDigest.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CatalogDigest}'''"); + } + else + { + builder.AppendLine($"'{CatalogDigest}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistryPipelineRunContent)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistryPipelineRunContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectedRegistryPipelineRunContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistryPipelineRunContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.cs new file mode 100644 index 000000000000..4161ebbfeff4 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The request properties provided for a pipeline run. + public partial class ConnectedRegistryPipelineRunContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConnectedRegistryPipelineRunContent() + { + Artifacts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The resource ID of the pipeline to run. + /// + /// 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'). + /// + /// The source properties of the pipeline run. + /// The target properties of the pipeline run. + /// The digest of the tar used to transfer the artifacts. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistryPipelineRunContent(ResourceIdentifier pipelineResourceId, IList artifacts, ContainerRegistryPipelineRunSourceProperties source, ContainerRegistryPipelineRunTargetProperties target, string catalogDigest, IDictionary serializedAdditionalRawData) + { + PipelineResourceId = pipelineResourceId; + Artifacts = artifacts; + Source = source; + Target = target; + CatalogDigest = catalogDigest; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource ID of the pipeline to run. + [WirePath("pipelineResourceId")] + public ResourceIdentifier PipelineResourceId { get; set; } + /// + /// 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'). + /// + [WirePath("artifacts")] + public IList Artifacts { get; } + /// The source properties of the pipeline run. + [WirePath("source")] + public ContainerRegistryPipelineRunSourceProperties Source { get; set; } + /// The target properties of the pipeline run. + [WirePath("target")] + public ContainerRegistryPipelineRunTargetProperties Target { get; set; } + /// The digest of the tar used to transfer the artifacts. + [WirePath("catalogDigest")] + public string CatalogDigest { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPropertiesActivation.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPropertiesActivation.cs deleted file mode 100644 index 124a7f7eba9c..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPropertiesActivation.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The ConnectedRegistryPropertiesActivation. - internal partial class ConnectedRegistryPropertiesActivation : ConnectedRegistryActivation - { - /// Initializes a new instance of . - internal ConnectedRegistryPropertiesActivation() - { - } - - /// Initializes a new instance of . - /// The activation status of the connected registry. - /// Keeps track of any properties unknown to the library. - internal ConnectedRegistryPropertiesActivation(ConnectedRegistryActivationStatus? status, IDictionary serializedAdditionalRawData) : base(status, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.Serialization.cs new file mode 100644 index 000000000000..e600f9f90f8d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryArchivePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryArchivePatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(PublishedVersion)) + { + writer.WritePropertyName("publishedVersion"u8); + writer.WriteStringValue(PublishedVersion); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryArchivePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryArchivePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryArchivePatch(document.RootElement, options); + } + + internal static ContainerRegistryArchivePatch DeserializeContainerRegistryArchivePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string publishedVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("publishedVersion"u8)) + { + publishedVersion = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryArchivePatch(publishedVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + default: + throw new FormatException($"The model {nameof(ContainerRegistryArchivePatch)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryArchivePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerRegistryArchivePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryArchivePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.cs new file mode 100644 index 000000000000..df33a7aeb055 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The parameters for updating a archive. + public partial class ContainerRegistryArchivePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryArchivePatch() + { + } + + /// Initializes a new instance of . + /// The published version of the archive. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryArchivePatch(string publishedVersion, IDictionary serializedAdditionalRawData) + { + PublishedVersion = publishedVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The published version of the archive. + [WirePath("properties.publishedVersion")] + public string PublishedVersion { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentials.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentials.Serialization.cs index 71fb7d33c80e..653a34ddfb0f 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentials.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentials.Serialization.cs @@ -138,14 +138,11 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceRegistryLoginMode", out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceRegistry), out propertyOverride); if (hasPropertyOverride) { builder.Append(" sourceRegistry: "); - builder.AppendLine("{"); - builder.Append(" loginMode: "); builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); } else { diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentials.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentials.cs index 9009c6d670ae..f46b7ea57557 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentials.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentials.cs @@ -67,24 +67,8 @@ internal ContainerRegistryCredentials(SourceRegistryCredentials sourceRegistry, } /// Describes the credential parameters for accessing the source registry. - internal SourceRegistryCredentials SourceRegistry { get; set; } - /// - /// The authentication mode which determines the source registry login scope. The credentials for the source registry - /// will be generated using the given scope. These credentials will be used to login to - /// the source registry during the run. - /// - [WirePath("sourceRegistry.loginMode")] - public SourceRegistryLoginMode? SourceRegistryLoginMode - { - get => SourceRegistry is null ? default : SourceRegistry.LoginMode; - set - { - if (SourceRegistry is null) - SourceRegistry = new SourceRegistryCredentials(); - SourceRegistry.LoginMode = value; - } - } - + [WirePath("sourceRegistry")] + public SourceRegistryCredentials SourceRegistry { get; set; } /// /// Describes the credential parameters for accessing other custom registries. The key /// for the dictionary item will be the registry login server (myregistry.azurecr.io) and diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryMetadataSearch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryMetadataSearch.cs new file mode 100644 index 000000000000..6ce891fd0388 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryMetadataSearch.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// Determines whether registry artifacts are indexed for metadata search. + public readonly partial struct ContainerRegistryMetadataSearch : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryMetadataSearch(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static ContainerRegistryMetadataSearch Enabled { get; } = new ContainerRegistryMetadataSearch(EnabledValue); + /// Disabled. + public static ContainerRegistryMetadataSearch Disabled { get; } = new ContainerRegistryMetadataSearch(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryMetadataSearch left, ContainerRegistryMetadataSearch right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryMetadataSearch left, ContainerRegistryMetadataSearch right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryMetadataSearch(string value) => new ContainerRegistryMetadataSearch(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryMetadataSearch other && Equals(other); + /// + public bool Equals(ContainerRegistryMetadataSearch other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.Serialization.cs index ff0d2219c4e1..907dc457b4ce 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.Serialization.cs @@ -38,6 +38,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(Name); writer.WritePropertyName("type"u8); writer.WriteStringValue(ResourceType.ToString()); + if (Optional.IsDefined(ResourceGroupName)) + { + writer.WritePropertyName("resourceGroupName"u8); + writer.WriteStringValue(ResourceGroupName); + } + if (Optional.IsDefined(AutoGeneratedDomainNameLabelScope)) + { + writer.WritePropertyName("autoGeneratedDomainNameLabelScope"u8); + writer.WriteStringValue(AutoGeneratedDomainNameLabelScope.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,6 +87,8 @@ internal static ContainerRegistryNameAvailabilityContent DeserializeContainerReg } string name = default; ContainerRegistryResourceType type = default; + string resourceGroupName = default; + AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -91,13 +103,27 @@ internal static ContainerRegistryNameAvailabilityContent DeserializeContainerReg type = new ContainerRegistryResourceType(property.Value.GetString()); continue; } + if (property.NameEquals("resourceGroupName"u8)) + { + resourceGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoGeneratedDomainNameLabelScope"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoGeneratedDomainNameLabelScope = new AutoGeneratedDomainNameLabelScope(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerRegistryNameAvailabilityContent(name, type, serializedAdditionalRawData); + return new ContainerRegistryNameAvailabilityContent(name, type, resourceGroupName, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.cs index 467ee56cc19c..bde516a1947a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.cs @@ -59,11 +59,15 @@ public ContainerRegistryNameAvailabilityContent(string name) /// Initializes a new instance of . /// The name of the container registry. /// The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + /// The resource group name of the container registry. + /// The auto generated domain name label of the container registry. This value defaults to "Unsecure". /// Keeps track of any properties unknown to the library. - internal ContainerRegistryNameAvailabilityContent(string name, ContainerRegistryResourceType resourceType, IDictionary serializedAdditionalRawData) + internal ContainerRegistryNameAvailabilityContent(string name, ContainerRegistryResourceType resourceType, string resourceGroupName, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, IDictionary serializedAdditionalRawData) { Name = name; ResourceType = resourceType; + ResourceGroupName = resourceGroupName; + AutoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -78,5 +82,11 @@ internal ContainerRegistryNameAvailabilityContent() /// The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. [WirePath("type")] public ContainerRegistryResourceType ResourceType { get; } + /// The resource group name of the container registry. + [WirePath("resourceGroupName")] + public string ResourceGroupName { get; set; } + /// The auto generated domain name label of the container registry. This value defaults to "Unsecure". + [WirePath("autoGeneratedDomainNameLabelScope")] + public AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.Serialization.cs index 2dfe064295cd..2068638d7060 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.Serialization.cs @@ -35,6 +35,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ContainerRegistryNameAvailableResult)} does not support writing '{format}' format."); } + if (Optional.IsDefined(AvailableLoginServerName)) + { + writer.WritePropertyName("availableLoginServerName"u8); + writer.WriteStringValue(AvailableLoginServerName); + } if (Optional.IsDefined(IsNameAvailable)) { writer.WritePropertyName("nameAvailable"u8); @@ -87,6 +92,7 @@ internal static ContainerRegistryNameAvailableResult DeserializeContainerRegistr { return null; } + string availableLoginServerName = default; bool? nameAvailable = default; string reason = default; string message = default; @@ -94,6 +100,11 @@ internal static ContainerRegistryNameAvailableResult DeserializeContainerRegistr Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("availableLoginServerName"u8)) + { + availableLoginServerName = property.Value.GetString(); + continue; + } if (property.NameEquals("nameAvailable"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -119,7 +130,7 @@ internal static ContainerRegistryNameAvailableResult DeserializeContainerRegistr } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerRegistryNameAvailableResult(nameAvailable, reason, message, serializedAdditionalRawData); + return new ContainerRegistryNameAvailableResult(availableLoginServerName, nameAvailable, reason, message, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -133,6 +144,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AvailableLoginServerName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" availableLoginServerName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AvailableLoginServerName)) + { + builder.Append(" availableLoginServerName: "); + if (AvailableLoginServerName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AvailableLoginServerName}'''"); + } + else + { + builder.AppendLine($"'{AvailableLoginServerName}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsNameAvailable), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.cs index f283691e35d6..58cc7b79002e 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.cs @@ -51,18 +51,23 @@ internal ContainerRegistryNameAvailableResult() } /// Initializes a new instance of . + /// The complete login server name with domain name label (DNL) hash, if available. /// The value that indicates whether the name is available. /// If any, the reason that the name is not available. /// If any, the error message that provides more detail for the reason that the name is not available. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryNameAvailableResult(bool? isNameAvailable, string reason, string message, IDictionary serializedAdditionalRawData) + internal ContainerRegistryNameAvailableResult(string availableLoginServerName, bool? isNameAvailable, string reason, string message, IDictionary serializedAdditionalRawData) { + AvailableLoginServerName = availableLoginServerName; IsNameAvailable = isNameAvailable; Reason = reason; Message = message; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// The complete login server name with domain name label (DNL) hash, if available. + [WirePath("availableLoginServerName")] + public string AvailableLoginServerName { get; } /// The value that indicates whether the name is available. [WirePath("nameAvailable")] public bool? IsNameAvailable { get; } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs index d3100a12b312..8537746414e4 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs @@ -98,6 +98,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("anonymousPullEnabled"u8); writer.WriteBooleanValue(IsAnonymousPullEnabled.Value); } + if (Optional.IsDefined(MetadataSearch)) + { + writer.WritePropertyName("metadataSearch"u8); + writer.WriteStringValue(MetadataSearch.Value.ToString()); + } + if (Optional.IsDefined(RoleAssignmentMode)) + { + writer.WritePropertyName("roleAssignmentMode"u8); + writer.WriteStringValue(RoleAssignmentMode.Value.ToString()); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -147,6 +157,8 @@ internal static ContainerRegistryPatch DeserializeContainerRegistryPatch(JsonEle ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default; ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default; bool? anonymousPullEnabled = default; + ContainerRegistryMetadataSearch? metadataSearch = default; + ContainerRegistryRoleAssignmentMode? roleAssignmentMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -264,6 +276,24 @@ internal static ContainerRegistryPatch DeserializeContainerRegistryPatch(JsonEle anonymousPullEnabled = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("metadataSearch"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metadataSearch = new ContainerRegistryMetadataSearch(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("roleAssignmentMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + roleAssignmentMode = new ContainerRegistryRoleAssignmentMode(property0.Value.GetString()); + continue; + } } continue; } @@ -285,6 +315,8 @@ internal static ContainerRegistryPatch DeserializeContainerRegistryPatch(JsonEle publicNetworkAccess, networkRuleBypassOptions, anonymousPullEnabled, + metadataSearch, + roleAssignmentMode, serializedAdditionalRawData); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs index fbef70e6a45a..670b664233c1 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs @@ -64,8 +64,10 @@ public ContainerRegistryPatch() /// Whether or not public network access is allowed for the container registry. /// Whether to allow trusted Azure services to access a network restricted registry. /// Enables registry-wide pull from unauthenticated clients. + /// Determines whether registry artifacts are indexed for metadata search. + /// Determines registry role assignment mode. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryPatch(ManagedServiceIdentity identity, IDictionary tags, ContainerRegistrySku sku, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, bool? isAnonymousPullEnabled, IDictionary serializedAdditionalRawData) + internal ContainerRegistryPatch(ManagedServiceIdentity identity, IDictionary tags, ContainerRegistrySku sku, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, bool? isAnonymousPullEnabled, ContainerRegistryMetadataSearch? metadataSearch, ContainerRegistryRoleAssignmentMode? roleAssignmentMode, IDictionary serializedAdditionalRawData) { Identity = identity; Tags = tags; @@ -78,6 +80,8 @@ internal ContainerRegistryPatch(ManagedServiceIdentity identity, IDictionary Enables registry-wide pull from unauthenticated clients. [WirePath("properties.anonymousPullEnabled")] public bool? IsAnonymousPullEnabled { get; set; } + /// Determines whether registry artifacts are indexed for metadata search. + [WirePath("properties.metadataSearch")] + public ContainerRegistryMetadataSearch? MetadataSearch { get; set; } + /// Determines registry role assignment mode. + [WirePath("properties.roleAssignmentMode")] + public ContainerRegistryRoleAssignmentMode? RoleAssignmentMode { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineOption.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineOption.cs new file mode 100644 index 000000000000..2e9963653f2d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineOption.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The ContainerRegistryPipelineOption. + public readonly partial struct ContainerRegistryPipelineOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryPipelineOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OverwriteTagsValue = "OverwriteTags"; + private const string OverwriteBlobsValue = "OverwriteBlobs"; + private const string DeleteSourceBlobOnSuccessValue = "DeleteSourceBlobOnSuccess"; + private const string ContinueOnErrorsValue = "ContinueOnErrors"; + + /// OverwriteTags. + public static ContainerRegistryPipelineOption OverwriteTags { get; } = new ContainerRegistryPipelineOption(OverwriteTagsValue); + /// OverwriteBlobs. + public static ContainerRegistryPipelineOption OverwriteBlobs { get; } = new ContainerRegistryPipelineOption(OverwriteBlobsValue); + /// DeleteSourceBlobOnSuccess. + public static ContainerRegistryPipelineOption DeleteSourceBlobOnSuccess { get; } = new ContainerRegistryPipelineOption(DeleteSourceBlobOnSuccessValue); + /// ContinueOnErrors. + public static ContainerRegistryPipelineOption ContinueOnErrors { get; } = new ContainerRegistryPipelineOption(ContinueOnErrorsValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryPipelineOption left, ContainerRegistryPipelineOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryPipelineOption left, ContainerRegistryPipelineOption right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryPipelineOption(string value) => new ContainerRegistryPipelineOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryPipelineOption other && Equals(other); + /// + public bool Equals(ContainerRegistryPipelineOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.Serialization.cs new file mode 100644 index 000000000000..6633af0a5f9a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryPipelineRunSourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunSourceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SourceType.Value.ToString()); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryPipelineRunSourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunSourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryPipelineRunSourceProperties(document.RootElement, options); + } + + internal static ContainerRegistryPipelineRunSourceProperties DeserializeContainerRegistryPipelineRunSourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerRegistryPipelineRunSourceType? type = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ContainerRegistryPipelineRunSourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryPipelineRunSourceProperties(type, name, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SourceType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{SourceType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunSourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryPipelineRunSourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerRegistryPipelineRunSourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunSourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.cs new file mode 100644 index 000000000000..f7d406e17ad9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The pipeline run source properties. + public partial class ContainerRegistryPipelineRunSourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryPipelineRunSourceProperties() + { + } + + /// Initializes a new instance of . + /// The type of the source. + /// The name of the source. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryPipelineRunSourceProperties(ContainerRegistryPipelineRunSourceType? sourceType, string name, IDictionary serializedAdditionalRawData) + { + SourceType = sourceType; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of the source. + [WirePath("type")] + public ContainerRegistryPipelineRunSourceType? SourceType { get; set; } + /// The name of the source. + [WirePath("name")] + public string Name { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceType.cs new file mode 100644 index 000000000000..f3f9a8153f3d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The type of the source. + public readonly partial struct ContainerRegistryPipelineRunSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryPipelineRunSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureStorageBlobValue = "AzureStorageBlob"; + + /// AzureStorageBlob. + public static ContainerRegistryPipelineRunSourceType AzureStorageBlob { get; } = new ContainerRegistryPipelineRunSourceType(AzureStorageBlobValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryPipelineRunSourceType left, ContainerRegistryPipelineRunSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryPipelineRunSourceType left, ContainerRegistryPipelineRunSourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryPipelineRunSourceType(string value) => new ContainerRegistryPipelineRunSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryPipelineRunSourceType other && Equals(other); + /// + public bool Equals(ContainerRegistryPipelineRunSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.Serialization.cs new file mode 100644 index 000000000000..90c61d12262a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryPipelineRunTargetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunTargetProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TargetType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TargetType.Value.ToString()); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryPipelineRunTargetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunTargetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryPipelineRunTargetProperties(document.RootElement, options); + } + + internal static ContainerRegistryPipelineRunTargetProperties DeserializeContainerRegistryPipelineRunTargetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerRegistryPipelineRunTargetType? type = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ContainerRegistryPipelineRunTargetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryPipelineRunTargetProperties(type, name, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{TargetType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunTargetProperties)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryPipelineRunTargetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerRegistryPipelineRunTargetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunTargetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.cs new file mode 100644 index 000000000000..548467f4dbc8 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The pipeline run target properties. + public partial class ContainerRegistryPipelineRunTargetProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryPipelineRunTargetProperties() + { + } + + /// Initializes a new instance of . + /// The type of the target. + /// The name of the target. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryPipelineRunTargetProperties(ContainerRegistryPipelineRunTargetType? targetType, string name, IDictionary serializedAdditionalRawData) + { + TargetType = targetType; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of the target. + [WirePath("type")] + public ContainerRegistryPipelineRunTargetType? TargetType { get; set; } + /// The name of the target. + [WirePath("name")] + public string Name { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetType.cs new file mode 100644 index 000000000000..3d6e3b5b8604 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The type of the target. + public readonly partial struct ContainerRegistryPipelineRunTargetType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryPipelineRunTargetType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureStorageBlobValue = "AzureStorageBlob"; + + /// AzureStorageBlob. + public static ContainerRegistryPipelineRunTargetType AzureStorageBlob { get; } = new ContainerRegistryPipelineRunTargetType(AzureStorageBlobValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryPipelineRunTargetType left, ContainerRegistryPipelineRunTargetType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryPipelineRunTargetType left, ContainerRegistryPipelineRunTargetType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryPipelineRunTargetType(string value) => new ContainerRegistryPipelineRunTargetType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryPipelineRunTargetType other && Equals(other); + /// + public bool Equals(ContainerRegistryPipelineRunTargetType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineSourceType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineSourceType.cs new file mode 100644 index 000000000000..a60f2cdd8bfa --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineSourceType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The type of source for the import pipeline. + public readonly partial struct ContainerRegistryPipelineSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryPipelineSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureStorageBlobContainerValue = "AzureStorageBlobContainer"; + + /// AzureStorageBlobContainer. + public static ContainerRegistryPipelineSourceType AzureStorageBlobContainer { get; } = new ContainerRegistryPipelineSourceType(AzureStorageBlobContainerValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryPipelineSourceType left, ContainerRegistryPipelineSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryPipelineSourceType left, ContainerRegistryPipelineSourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryPipelineSourceType(string value) => new ContainerRegistryPipelineSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryPipelineSourceType other && Equals(other); + /// + public bool Equals(ContainerRegistryPipelineSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs index 43209b6b53df..531430836cfe 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs @@ -60,6 +60,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("azureADAuthenticationAsArmPolicy"u8); writer.WriteObjectValue(AzureADAuthenticationAsArmPolicy, options); } + if (Optional.IsDefined(SoftDeletePolicy)) + { + writer.WritePropertyName("softDeletePolicy"u8); + writer.WriteObjectValue(SoftDeletePolicy, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -102,6 +107,7 @@ internal static ContainerRegistryPolicies DeserializeContainerRegistryPolicies(J ContainerRegistryRetentionPolicy retentionPolicy = default; ContainerRegistryExportPolicy exportPolicy = default; AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy = default; + ContainerRegistrySoftDeletePolicy softDeletePolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -151,6 +157,15 @@ internal static ContainerRegistryPolicies DeserializeContainerRegistryPolicies(J azureADAuthenticationAsArmPolicy = AzureADAuthenticationAsArmPolicy.DeserializeAzureADAuthenticationAsArmPolicy(property.Value, options); continue; } + if (property.NameEquals("softDeletePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softDeletePolicy = ContainerRegistrySoftDeletePolicy.DeserializeContainerRegistrySoftDeletePolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,6 +178,7 @@ internal static ContainerRegistryPolicies DeserializeContainerRegistryPolicies(J retentionPolicy, exportPolicy, azureADAuthenticationAsArmPolicy, + softDeletePolicy, serializedAdditionalRawData); } @@ -261,6 +277,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SoftDeletePolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" softDeletePolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SoftDeletePolicy)) + { + builder.Append(" softDeletePolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, SoftDeletePolicy, options, 2, false, " softDeletePolicy: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs index 206355707397..254dfd394aee 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs @@ -56,14 +56,16 @@ public ContainerRegistryPolicies() /// The retention policy for a container registry. /// The export policy for a container registry. /// The policy for using ARM audience token for a container registry. + /// The soft delete policy for a container registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryPolicies(ContainerRegistryQuarantinePolicy quarantinePolicy, ContainerRegistryTrustPolicy trustPolicy, ContainerRegistryRetentionPolicy retentionPolicy, ContainerRegistryExportPolicy exportPolicy, AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy, IDictionary serializedAdditionalRawData) + internal ContainerRegistryPolicies(ContainerRegistryQuarantinePolicy quarantinePolicy, ContainerRegistryTrustPolicy trustPolicy, ContainerRegistryRetentionPolicy retentionPolicy, ContainerRegistryExportPolicy exportPolicy, AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy, ContainerRegistrySoftDeletePolicy softDeletePolicy, IDictionary serializedAdditionalRawData) { QuarantinePolicy = quarantinePolicy; TrustPolicy = trustPolicy; RetentionPolicy = retentionPolicy; ExportPolicy = exportPolicy; AzureADAuthenticationAsArmPolicy = azureADAuthenticationAsArmPolicy; + SoftDeletePolicy = softDeletePolicy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -117,5 +119,9 @@ public AadAuthenticationAsArmPolicyStatus? AzureADAuthenticationAsArmStatus AzureADAuthenticationAsArmPolicy.Status = value; } } + + /// The soft delete policy for a container registry. + [WirePath("softDeletePolicy")] + public ContainerRegistrySoftDeletePolicy SoftDeletePolicy { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryProvisioningState.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryProvisioningState.cs index bbb6fc247938..494d9ce78f5c 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryProvisioningState.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryProvisioningState.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ContainerRegistry.Models { - /// The provisioning state of this agent pool. + /// The provisioning state of the archive at the time the operation was called. public readonly partial struct ContainerRegistryProvisioningState : IEquatable { private readonly string _value; diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryRoleAssignmentMode.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryRoleAssignmentMode.cs new file mode 100644 index 000000000000..d827654379a1 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryRoleAssignmentMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// Determines registry role assignment mode. + public readonly partial struct ContainerRegistryRoleAssignmentMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryRoleAssignmentMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AbacRepositoryPermissionsValue = "AbacRepositoryPermissions"; + private const string LegacyRegistryPermissionsValue = "LegacyRegistryPermissions"; + + /// AbacRepositoryPermissions. + public static ContainerRegistryRoleAssignmentMode AbacRepositoryPermissions { get; } = new ContainerRegistryRoleAssignmentMode(AbacRepositoryPermissionsValue); + /// LegacyRegistryPermissions. + public static ContainerRegistryRoleAssignmentMode LegacyRegistryPermissions { get; } = new ContainerRegistryRoleAssignmentMode(LegacyRegistryPermissionsValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryRoleAssignmentMode left, ContainerRegistryRoleAssignmentMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryRoleAssignmentMode left, ContainerRegistryRoleAssignmentMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryRoleAssignmentMode(string value) => new ContainerRegistryRoleAssignmentMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryRoleAssignmentMode other && Equals(other); + /// + public bool Equals(ContainerRegistryRoleAssignmentMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs new file mode 100644 index 000000000000..eb631315b6b8 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistrySoftDeletePolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistrySoftDeletePolicy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RetentionDays)) + { + writer.WritePropertyName("retentionDays"u8); + writer.WriteNumberValue(RetentionDays.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastUpdatedOn)) + { + writer.WritePropertyName("lastUpdatedTime"u8); + writer.WriteStringValue(LastUpdatedOn.Value, "O"); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistrySoftDeletePolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistrySoftDeletePolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistrySoftDeletePolicy(document.RootElement, options); + } + + internal static ContainerRegistrySoftDeletePolicy DeserializeContainerRegistrySoftDeletePolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? retentionDays = default; + DateTimeOffset? lastUpdatedTime = default; + ContainerRegistryPolicyStatus? status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("retentionDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retentionDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("lastUpdatedTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastUpdatedTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new ContainerRegistryPolicyStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistrySoftDeletePolicy(retentionDays, lastUpdatedTime, status, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RetentionDays), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" retentionDays: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RetentionDays)) + { + builder.Append(" retentionDays: "); + builder.AppendLine($"{RetentionDays.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastUpdatedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastUpdatedTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastUpdatedOn)) + { + builder.Append(" lastUpdatedTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastUpdatedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistrySoftDeletePolicy)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistrySoftDeletePolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerRegistrySoftDeletePolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistrySoftDeletePolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs new file mode 100644 index 000000000000..36898949580d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The soft delete policy for a container registry. + public partial class ContainerRegistrySoftDeletePolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistrySoftDeletePolicy() + { + } + + /// Initializes a new instance of . + /// The number of days after which a soft-deleted item is permanently deleted. + /// The timestamp when the policy was last updated. + /// The value that indicates whether the policy is enabled or not. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistrySoftDeletePolicy(int? retentionDays, DateTimeOffset? lastUpdatedOn, ContainerRegistryPolicyStatus? status, IDictionary serializedAdditionalRawData) + { + RetentionDays = retentionDays; + LastUpdatedOn = lastUpdatedOn; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The number of days after which a soft-deleted item is permanently deleted. + [WirePath("retentionDays")] + public int? RetentionDays { get; set; } + /// The timestamp when the policy was last updated. + [WirePath("lastUpdatedTime")] + public DateTimeOffset? LastUpdatedOn { get; } + /// The value that indicates whether the policy is enabled or not. + [WirePath("status")] + public ContainerRegistryPolicyStatus? Status { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTriggerStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTriggerStatus.cs index 3c29f8ab4c6b..9e47207b7898 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTriggerStatus.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTriggerStatus.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ContainerRegistry.Models { - /// The current status of trigger. + /// The current status of the source trigger. public readonly partial struct ContainerRegistryTriggerStatus : IEquatable { private readonly string _value; @@ -22,13 +22,13 @@ public ContainerRegistryTriggerStatus(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string DisabledValue = "Disabled"; private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; - /// Disabled. - public static ContainerRegistryTriggerStatus Disabled { get; } = new ContainerRegistryTriggerStatus(DisabledValue); /// Enabled. public static ContainerRegistryTriggerStatus Enabled { get; } = new ContainerRegistryTriggerStatus(EnabledValue); + /// Disabled. + public static ContainerRegistryTriggerStatus Disabled { get; } = new ContainerRegistryTriggerStatus(DisabledValue); /// Determines if two values are the same. public static bool operator ==(ContainerRegistryTriggerStatus left, ContainerRegistryTriggerStatus right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs new file mode 100644 index 000000000000..07d640dfe386 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class ExportPipelineListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportPipelineListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportPipelineListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportPipelineListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportPipelineListResult(document.RootElement, options); + } + + internal static ExportPipelineListResult DeserializeExportPipelineListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportPipelineListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ExportPipelineListResult)} does not support writing '{options.Format}' format."); + } + } + + ExportPipelineListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExportPipelineListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportPipelineListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs new file mode 100644 index 000000000000..52e7335391f7 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list export pipelines for a container registry. + internal partial class ExportPipelineListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ExportPipelineListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. + /// The URI that can be used to request the next list of pipeline runs. + /// Keeps track of any properties unknown to the library. + internal ExportPipelineListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of pipeline runs. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs new file mode 100644 index 000000000000..b4c1fa9b1f6e --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ExportPipelineTargetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportPipelineTargetProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PipelineTargetType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(PipelineTargetType); + } + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + if (Optional.IsDefined(KeyVaultUri)) + { + writer.WritePropertyName("keyVaultUri"u8); + writer.WriteStringValue(KeyVaultUri.AbsoluteUri); + } + if (Optional.IsDefined(StorageAccessMode)) + { + writer.WritePropertyName("storageAccessMode"u8); + writer.WriteStringValue(StorageAccessMode.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportPipelineTargetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportPipelineTargetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportPipelineTargetProperties(document.RootElement, options); + } + + internal static ExportPipelineTargetProperties DeserializeExportPipelineTargetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + Uri uri = default; + Uri keyVaultUri = default; + StorageAccessMode? storageAccessMode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("uri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("keyVaultUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyVaultUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageAccessMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccessMode = new StorageAccessMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportPipelineTargetProperties(type, uri, keyVaultUri, storageAccessMode, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PipelineTargetType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PipelineTargetType)) + { + builder.Append(" type: "); + if (PipelineTargetType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PipelineTargetType}'''"); + } + else + { + builder.AppendLine($"'{PipelineTargetType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" uri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Uri)) + { + builder.Append(" uri: "); + builder.AppendLine($"'{Uri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyVaultUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" keyVaultUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(KeyVaultUri)) + { + builder.Append(" keyVaultUri: "); + builder.AppendLine($"'{KeyVaultUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StorageAccessMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" storageAccessMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StorageAccessMode)) + { + builder.Append(" storageAccessMode: "); + builder.AppendLine($"'{StorageAccessMode.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ExportPipelineTargetProperties)} does not support writing '{options.Format}' format."); + } + } + + ExportPipelineTargetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExportPipelineTargetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportPipelineTargetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs new file mode 100644 index 000000000000..9309731972b4 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The properties of the export pipeline target. + public partial class ExportPipelineTargetProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportPipelineTargetProperties() + { + } + + /// Initializes a new instance of . + /// The type of target for the export pipeline. + /// + /// 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" + /// + /// They key vault secret uri to obtain the target storage SAS token. + /// The storage access mode used for the customer storage account. + /// Keeps track of any properties unknown to the library. + internal ExportPipelineTargetProperties(string pipelineTargetType, Uri uri, Uri keyVaultUri, StorageAccessMode? storageAccessMode, IDictionary serializedAdditionalRawData) + { + PipelineTargetType = pipelineTargetType; + Uri = uri; + KeyVaultUri = keyVaultUri; + StorageAccessMode = storageAccessMode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of target for the export pipeline. + [WirePath("type")] + public string PipelineTargetType { get; set; } + /// + /// 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" + /// + [WirePath("uri")] + public Uri Uri { get; set; } + /// They key vault secret uri to obtain the target storage SAS token. + [WirePath("keyVaultUri")] + public Uri KeyVaultUri { get; set; } + /// The storage access mode used for the customer storage account. + [WirePath("storageAccessMode")] + public StorageAccessMode? StorageAccessMode { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs new file mode 100644 index 000000000000..a268e516f990 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class ImportPipelineListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportPipelineListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImportPipelineListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportPipelineListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImportPipelineListResult(document.RootElement, options); + } + + internal static ImportPipelineListResult DeserializeImportPipelineListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImportPipelineListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ImportPipelineListResult)} does not support writing '{options.Format}' format."); + } + } + + ImportPipelineListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeImportPipelineListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImportPipelineListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs new file mode 100644 index 000000000000..99757c2ac8e4 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list import pipelines for a container registry. + internal partial class ImportPipelineListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ImportPipelineListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of import pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of import pipelines. + /// The URI that can be used to request the next list of pipeline runs. + /// Keeps track of any properties unknown to the library. + internal ImportPipelineListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of import pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of import pipelines. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of pipeline runs. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs new file mode 100644 index 000000000000..ad32fce276a4 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ImportPipelineSourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportPipelineSourceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ContainerRegistryPipelineSourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ContainerRegistryPipelineSourceType.Value.ToString()); + } + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + if (Optional.IsDefined(KeyVaultUri)) + { + writer.WritePropertyName("keyVaultUri"u8); + writer.WriteStringValue(KeyVaultUri.AbsoluteUri); + } + if (Optional.IsDefined(StorageAccessMode)) + { + writer.WritePropertyName("storageAccessMode"u8); + writer.WriteStringValue(StorageAccessMode.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImportPipelineSourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportPipelineSourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImportPipelineSourceProperties(document.RootElement, options); + } + + internal static ImportPipelineSourceProperties DeserializeImportPipelineSourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerRegistryPipelineSourceType? type = default; + Uri uri = default; + Uri keyVaultUri = default; + StorageAccessMode? storageAccessMode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ContainerRegistryPipelineSourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("uri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("keyVaultUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyVaultUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageAccessMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccessMode = new StorageAccessMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImportPipelineSourceProperties(type, uri, keyVaultUri, storageAccessMode, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerRegistryPipelineSourceType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ContainerRegistryPipelineSourceType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{ContainerRegistryPipelineSourceType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" uri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Uri)) + { + builder.Append(" uri: "); + builder.AppendLine($"'{Uri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyVaultUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" keyVaultUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(KeyVaultUri)) + { + builder.Append(" keyVaultUri: "); + builder.AppendLine($"'{KeyVaultUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StorageAccessMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" storageAccessMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StorageAccessMode)) + { + builder.Append(" storageAccessMode: "); + builder.AppendLine($"'{StorageAccessMode.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ImportPipelineSourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ImportPipelineSourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeImportPipelineSourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImportPipelineSourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs new file mode 100644 index 000000000000..5534a21c22f3 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The properties of the import pipeline source. + public partial class ImportPipelineSourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ImportPipelineSourceProperties() + { + } + + /// Initializes a new instance of . + /// The type of source for the import pipeline. + /// + /// 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" + /// + /// They key vault secret uri to obtain the source storage SAS token. + /// The storage access mode used for the customer storage account. + /// Keeps track of any properties unknown to the library. + internal ImportPipelineSourceProperties(ContainerRegistryPipelineSourceType? containerRegistryPipelineSourceType, Uri uri, Uri keyVaultUri, StorageAccessMode? storageAccessMode, IDictionary serializedAdditionalRawData) + { + ContainerRegistryPipelineSourceType = containerRegistryPipelineSourceType; + Uri = uri; + KeyVaultUri = keyVaultUri; + StorageAccessMode = storageAccessMode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of source for the import pipeline. + [WirePath("type")] + public ContainerRegistryPipelineSourceType? ContainerRegistryPipelineSourceType { get; set; } + /// + /// 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" + /// + [WirePath("uri")] + public Uri Uri { get; set; } + /// They key vault secret uri to obtain the source storage SAS token. + [WirePath("keyVaultUri")] + public Uri KeyVaultUri { get; set; } + /// The storage access mode used for the customer storage account. + [WirePath("storageAccessMode")] + public StorageAccessMode? StorageAccessMode { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.Serialization.cs new file mode 100644 index 000000000000..0215f180ca71 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineProgress : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineProgress)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Percentage)) + { + writer.WritePropertyName("percentage"u8); + writer.WriteStringValue(Percentage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineProgress IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineProgress)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineProgress(document.RootElement, options); + } + + internal static PipelineProgress DeserializePipelineProgress(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string percentage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("percentage"u8)) + { + percentage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineProgress(percentage, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Percentage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" percentage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Percentage)) + { + builder.Append(" percentage: "); + if (Percentage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Percentage}'''"); + } + else + { + builder.AppendLine($"'{Percentage}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineProgress)} does not support writing '{options.Format}' format."); + } + } + + PipelineProgress IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePipelineProgress(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineProgress)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs new file mode 100644 index 000000000000..0ce828e4a0ef --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The progress properties. + internal partial class PipelineProgress + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PipelineProgress() + { + } + + /// Initializes a new instance of . + /// The percentage complete of the copy operation. + /// Keeps track of any properties unknown to the library. + internal PipelineProgress(string percentage, IDictionary serializedAdditionalRawData) + { + Percentage = percentage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The percentage complete of the copy operation. + [WirePath("percentage")] + public string Percentage { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs new file mode 100644 index 000000000000..abc19bf18558 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineRunListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineRunListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineRunListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineRunListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineRunListResult(document.RootElement, options); + } + + internal static PipelineRunListResult DeserializePipelineRunListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineRunListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineRunListResult)} does not support writing '{options.Format}' format."); + } + } + + PipelineRunListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePipelineRunListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineRunListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs new file mode 100644 index 000000000000..5e7444729a6b --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list pipeline runs for a container registry. + internal partial class PipelineRunListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PipelineRunListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of pipeline runs. Since this list may be incomplete, the nextLink field should be used to request the next list of pipeline runs. + /// The URI that can be used to request the next list of pipeline runs. + /// Keeps track of any properties unknown to the library. + internal PipelineRunListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of pipeline runs. Since this list may be incomplete, the nextLink field should be used to request the next list of pipeline runs. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of pipeline runs. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs new file mode 100644 index 000000000000..148cc4024a94 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class PipelineRunResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineRunResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (Optional.IsCollectionDefined(ImportedArtifacts)) + { + writer.WritePropertyName("importedArtifacts"u8); + writer.WriteStartArray(); + foreach (var item in ImportedArtifacts) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Progress)) + { + writer.WritePropertyName("progress"u8); + writer.WriteObjectValue(Progress, options); + } + if (Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (Optional.IsDefined(FinishOn)) + { + writer.WritePropertyName("finishTime"u8); + writer.WriteStringValue(FinishOn.Value, "O"); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteObjectValue(Target, options); + } + if (Optional.IsDefined(CatalogDigest)) + { + writer.WritePropertyName("catalogDigest"u8); + writer.WriteStringValue(CatalogDigest); + } + if (Optional.IsDefined(Trigger)) + { + writer.WritePropertyName("trigger"u8); + writer.WriteObjectValue(Trigger, options); + } + if (Optional.IsDefined(PipelineRunErrorMessage)) + { + writer.WritePropertyName("pipelineRunErrorMessage"u8); + writer.WriteStringValue(PipelineRunErrorMessage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineRunResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineRunResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineRunResult(document.RootElement, options); + } + + internal static PipelineRunResult DeserializePipelineRunResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string status = default; + IReadOnlyList importedArtifacts = default; + PipelineProgress progress = default; + DateTimeOffset? startTime = default; + DateTimeOffset? finishTime = default; + ImportPipelineSourceProperties source = default; + ExportPipelineTargetProperties target = default; + string catalogDigest = default; + PipelineTriggerDescriptor trigger = default; + string pipelineRunErrorMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("importedArtifacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + importedArtifacts = array; + continue; + } + if (property.NameEquals("progress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + progress = PipelineProgress.DeserializePipelineProgress(property.Value, options); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("finishTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + finishTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = ImportPipelineSourceProperties.DeserializeImportPipelineSourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("target"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + target = ExportPipelineTargetProperties.DeserializeExportPipelineTargetProperties(property.Value, options); + continue; + } + if (property.NameEquals("catalogDigest"u8)) + { + catalogDigest = property.Value.GetString(); + continue; + } + if (property.NameEquals("trigger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trigger = PipelineTriggerDescriptor.DeserializePipelineTriggerDescriptor(property.Value, options); + continue; + } + if (property.NameEquals("pipelineRunErrorMessage"u8)) + { + pipelineRunErrorMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineRunResult( + status, + importedArtifacts ?? new ChangeTrackingList(), + progress, + startTime, + finishTime, + source, + target, + catalogDigest, + trigger, + pipelineRunErrorMessage, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + if (Status.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Status}'''"); + } + else + { + builder.AppendLine($"'{Status}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ImportedArtifacts), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" importedArtifacts: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ImportedArtifacts)) + { + if (ImportedArtifacts.Any()) + { + builder.Append(" importedArtifacts: "); + builder.AppendLine("["); + foreach (var item in ImportedArtifacts) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ProgressPercentage", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" progress: "); + builder.AppendLine("{"); + builder.Append(" percentage: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Progress)) + { + builder.Append(" progress: "); + BicepSerializationHelpers.AppendChildObject(builder, Progress, options, 2, false, " progress: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" startTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StartOn)) + { + builder.Append(" startTime: "); + var formattedDateTimeString = TypeFormatters.ToString(StartOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FinishOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" finishTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FinishOn)) + { + builder.Append(" finishTime: "); + var formattedDateTimeString = TypeFormatters.ToString(FinishOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + BicepSerializationHelpers.AppendChildObject(builder, Target, options, 2, false, " target: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CatalogDigest), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" catalogDigest: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CatalogDigest)) + { + builder.Append(" catalogDigest: "); + if (CatalogDigest.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CatalogDigest}'''"); + } + else + { + builder.AppendLine($"'{CatalogDigest}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceTriggerTimestamp", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" trigger: "); + builder.AppendLine("{"); + builder.AppendLine(" sourceTrigger: {"); + builder.Append(" timestamp: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Trigger)) + { + builder.Append(" trigger: "); + BicepSerializationHelpers.AppendChildObject(builder, Trigger, options, 2, false, " trigger: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PipelineRunErrorMessage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" pipelineRunErrorMessage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PipelineRunErrorMessage)) + { + builder.Append(" pipelineRunErrorMessage: "); + if (PipelineRunErrorMessage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PipelineRunErrorMessage}'''"); + } + else + { + builder.AppendLine($"'{PipelineRunErrorMessage}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineRunResult)} does not support writing '{options.Format}' format."); + } + } + + PipelineRunResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePipelineRunResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineRunResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs new file mode 100644 index 000000000000..ce39d76d06c9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The response properties returned for a pipeline run. + public partial class PipelineRunResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PipelineRunResult() + { + ImportedArtifacts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The current status of the pipeline run. + /// The artifacts imported in the pipeline run. + /// The current progress of the copy operation. + /// The time the pipeline run started. + /// The time the pipeline run finished. + /// The source of the pipeline run. + /// The target of the pipeline run. + /// The digest of the tar used to transfer the artifacts. + /// The trigger that caused the pipeline run. + /// The detailed error message for the pipeline run in the case of failure. + /// Keeps track of any properties unknown to the library. + internal PipelineRunResult(string status, IReadOnlyList importedArtifacts, PipelineProgress progress, DateTimeOffset? startOn, DateTimeOffset? finishOn, ImportPipelineSourceProperties source, ExportPipelineTargetProperties target, string catalogDigest, PipelineTriggerDescriptor trigger, string pipelineRunErrorMessage, IDictionary serializedAdditionalRawData) + { + Status = status; + ImportedArtifacts = importedArtifacts; + Progress = progress; + StartOn = startOn; + FinishOn = finishOn; + Source = source; + Target = target; + CatalogDigest = catalogDigest; + Trigger = trigger; + PipelineRunErrorMessage = pipelineRunErrorMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The current status of the pipeline run. + [WirePath("status")] + public string Status { get; } + /// The artifacts imported in the pipeline run. + [WirePath("importedArtifacts")] + public IReadOnlyList ImportedArtifacts { get; } + /// The current progress of the copy operation. + internal PipelineProgress Progress { get; } + /// The percentage complete of the copy operation. + [WirePath("progress.percentage")] + public string ProgressPercentage + { + get => Progress?.Percentage; + } + + /// The time the pipeline run started. + [WirePath("startTime")] + public DateTimeOffset? StartOn { get; } + /// The time the pipeline run finished. + [WirePath("finishTime")] + public DateTimeOffset? FinishOn { get; } + /// The source of the pipeline run. + [WirePath("source")] + public ImportPipelineSourceProperties Source { get; } + /// The target of the pipeline run. + [WirePath("target")] + public ExportPipelineTargetProperties Target { get; } + /// The digest of the tar used to transfer the artifacts. + [WirePath("catalogDigest")] + public string CatalogDigest { get; } + /// The trigger that caused the pipeline run. + internal PipelineTriggerDescriptor Trigger { get; } + /// The timestamp when the source update happened. + [WirePath("trigger.sourceTrigger.timestamp")] + public DateTimeOffset? SourceTriggerTimestamp + { + get => Trigger?.SourceTriggerTimestamp; + } + + /// The detailed error message for the pipeline run in the case of failure. + [WirePath("pipelineRunErrorMessage")] + public string PipelineRunErrorMessage { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.Serialization.cs new file mode 100644 index 000000000000..868b9bb40ded --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineSourceTriggerDescriptor : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineSourceTriggerDescriptor)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineSourceTriggerDescriptor IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineSourceTriggerDescriptor)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineSourceTriggerDescriptor(document.RootElement, options); + } + + internal static PipelineSourceTriggerDescriptor DeserializePipelineSourceTriggerDescriptor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? timestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineSourceTriggerDescriptor(timestamp, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Timestamp), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" timestamp: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Timestamp)) + { + builder.Append(" timestamp: "); + var formattedDateTimeString = TypeFormatters.ToString(Timestamp.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineSourceTriggerDescriptor)} does not support writing '{options.Format}' format."); + } + } + + PipelineSourceTriggerDescriptor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePipelineSourceTriggerDescriptor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineSourceTriggerDescriptor)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs new file mode 100644 index 000000000000..d30b61db0581 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The pipeline source trigger descriptor. + internal partial class PipelineSourceTriggerDescriptor + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PipelineSourceTriggerDescriptor() + { + } + + /// Initializes a new instance of . + /// The timestamp when the source update happened. + /// Keeps track of any properties unknown to the library. + internal PipelineSourceTriggerDescriptor(DateTimeOffset? timestamp, IDictionary serializedAdditionalRawData) + { + Timestamp = timestamp; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The timestamp when the source update happened. + [WirePath("timestamp")] + public DateTimeOffset? Timestamp { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPropertiesActivation.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.Serialization.cs similarity index 55% rename from sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPropertiesActivation.Serialization.cs rename to sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.Serialization.cs index 1d71de6a5be5..774b31f9aba3 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPropertiesActivation.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.ContainerRegistry.Models { - internal partial class ConnectedRegistryPropertiesActivation : IUtf8JsonSerializable, IJsonModel + internal partial class PipelineSourceTriggerProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -27,30 +27,46 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConnectedRegistryPropertiesActivation)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PipelineSourceTriggerProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } - ConnectedRegistryPropertiesActivation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PipelineSourceTriggerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConnectedRegistryPropertiesActivation)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PipelineSourceTriggerProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeConnectedRegistryPropertiesActivation(document.RootElement, options); + return DeserializePipelineSourceTriggerProperties(document.RootElement, options); } - internal static ConnectedRegistryPropertiesActivation DeserializeConnectedRegistryPropertiesActivation(JsonElement element, ModelReaderWriterOptions options = null) + internal static PipelineSourceTriggerProperties DeserializePipelineSourceTriggerProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -58,18 +74,14 @@ internal static ConnectedRegistryPropertiesActivation DeserializeConnectedRegist { return null; } - ConnectedRegistryActivationStatus? status = default; + ContainerRegistryTriggerStatus status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("status"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new ConnectedRegistryActivationStatus(property.Value.GetString()); + status = new ContainerRegistryTriggerStatus(property.Value.GetString()); continue; } if (options.Format != "W") @@ -78,7 +90,7 @@ internal static ConnectedRegistryPropertiesActivation DeserializeConnectedRegist } } serializedAdditionalRawData = rawDataDictionary; - return new ConnectedRegistryPropertiesActivation(status, serializedAdditionalRawData); + return new PipelineSourceTriggerProperties(status, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -100,20 +112,17 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } else { - if (Optional.IsDefined(Status)) - { - builder.Append(" status: "); - builder.AppendLine($"'{Status.Value.ToString()}'"); - } + builder.Append(" status: "); + builder.AppendLine($"'{Status.ToString()}'"); } builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -122,26 +131,26 @@ BinaryData IPersistableModel.Write(ModelR case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ConnectedRegistryPropertiesActivation)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PipelineSourceTriggerProperties)} does not support writing '{options.Format}' format."); } } - ConnectedRegistryPropertiesActivation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PipelineSourceTriggerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeConnectedRegistryPropertiesActivation(document.RootElement, options); + return DeserializePipelineSourceTriggerProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ConnectedRegistryPropertiesActivation)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PipelineSourceTriggerProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs new file mode 100644 index 000000000000..78e8b72b8681 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The source trigger properties of the import pipeline. + internal partial class PipelineSourceTriggerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The current status of the source trigger. + public PipelineSourceTriggerProperties(ContainerRegistryTriggerStatus status) + { + Status = status; + } + + /// Initializes a new instance of . + /// The current status of the source trigger. + /// Keeps track of any properties unknown to the library. + internal PipelineSourceTriggerProperties(ContainerRegistryTriggerStatus status, IDictionary serializedAdditionalRawData) + { + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineSourceTriggerProperties() + { + } + + /// The current status of the source trigger. + [WirePath("status")] + public ContainerRegistryTriggerStatus Status { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.Serialization.cs new file mode 100644 index 000000000000..5b987de0dcc5 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineTriggerDescriptor : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineTriggerDescriptor)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SourceTrigger)) + { + writer.WritePropertyName("sourceTrigger"u8); + writer.WriteObjectValue(SourceTrigger, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineTriggerDescriptor IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineTriggerDescriptor)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineTriggerDescriptor(document.RootElement, options); + } + + internal static PipelineTriggerDescriptor DeserializePipelineTriggerDescriptor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PipelineSourceTriggerDescriptor sourceTrigger = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceTrigger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceTrigger = PipelineSourceTriggerDescriptor.DeserializePipelineSourceTriggerDescriptor(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineTriggerDescriptor(sourceTrigger, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceTriggerTimestamp", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceTrigger: "); + builder.AppendLine("{"); + builder.Append(" timestamp: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(SourceTrigger)) + { + builder.Append(" sourceTrigger: "); + BicepSerializationHelpers.AppendChildObject(builder, SourceTrigger, options, 2, false, " sourceTrigger: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineTriggerDescriptor)} does not support writing '{options.Format}' format."); + } + } + + PipelineTriggerDescriptor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePipelineTriggerDescriptor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineTriggerDescriptor)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs new file mode 100644 index 000000000000..b905d4185a97 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The pipeline trigger descriptor. + internal partial class PipelineTriggerDescriptor + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PipelineTriggerDescriptor() + { + } + + /// Initializes a new instance of . + /// The source trigger that caused the pipeline run. + /// Keeps track of any properties unknown to the library. + internal PipelineTriggerDescriptor(PipelineSourceTriggerDescriptor sourceTrigger, IDictionary serializedAdditionalRawData) + { + SourceTrigger = sourceTrigger; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The source trigger that caused the pipeline run. + internal PipelineSourceTriggerDescriptor SourceTrigger { get; } + /// The timestamp when the source update happened. + [WirePath("sourceTrigger.timestamp")] + public DateTimeOffset? SourceTriggerTimestamp + { + get => SourceTrigger?.Timestamp; + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs new file mode 100644 index 000000000000..6ad29d1d2eba --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineTriggerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineTriggerProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SourceTrigger)) + { + writer.WritePropertyName("sourceTrigger"u8); + writer.WriteObjectValue(SourceTrigger, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineTriggerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineTriggerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineTriggerProperties(document.RootElement, options); + } + + internal static PipelineTriggerProperties DeserializePipelineTriggerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PipelineSourceTriggerProperties sourceTrigger = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceTrigger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceTrigger = PipelineSourceTriggerProperties.DeserializePipelineSourceTriggerProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineTriggerProperties(sourceTrigger, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceTriggerStatus", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceTrigger: "); + builder.AppendLine("{"); + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(SourceTrigger)) + { + builder.Append(" sourceTrigger: "); + BicepSerializationHelpers.AppendChildObject(builder, SourceTrigger, options, 2, false, " sourceTrigger: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineTriggerProperties)} does not support writing '{options.Format}' format."); + } + } + + PipelineTriggerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePipelineTriggerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineTriggerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs new file mode 100644 index 000000000000..0e29cee6d411 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The trigger properties of the import pipeline. + internal partial class PipelineTriggerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PipelineTriggerProperties() + { + } + + /// Initializes a new instance of . + /// The source trigger properties of the pipeline. + /// Keeps track of any properties unknown to the library. + internal PipelineTriggerProperties(PipelineSourceTriggerProperties sourceTrigger, IDictionary serializedAdditionalRawData) + { + SourceTrigger = sourceTrigger; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The source trigger properties of the pipeline. + internal PipelineSourceTriggerProperties SourceTrigger { get; set; } + /// The current status of the source trigger. + [WirePath("sourceTrigger.status")] + public ContainerRegistryTriggerStatus? SourceTriggerStatus + { + get => SourceTrigger is null ? default(ContainerRegistryTriggerStatus?) : SourceTrigger.Status; + set + { + SourceTrigger = value.HasValue ? new PipelineSourceTriggerProperties(value.Value) : null; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.Serialization.cs index b4828f93052c..469357e093c2 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.Serialization.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ContainerRegistry.Models { - internal partial class SourceRegistryCredentials : IUtf8JsonSerializable, IJsonModel + public partial class SourceRegistryCredentials : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -35,6 +35,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SourceRegistryCredentials)} does not support writing '{format}' format."); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteStringValue(Identity); + } if (Optional.IsDefined(LoginMode)) { writer.WritePropertyName("loginMode"u8); @@ -77,11 +82,17 @@ internal static SourceRegistryCredentials DeserializeSourceRegistryCredentials(J { return null; } + string identity = default; SourceRegistryLoginMode? loginMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("identity"u8)) + { + identity = property.Value.GetString(); + continue; + } if (property.NameEquals("loginMode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -97,7 +108,7 @@ internal static SourceRegistryCredentials DeserializeSourceRegistryCredentials(J } } serializedAdditionalRawData = rawDataDictionary; - return new SourceRegistryCredentials(loginMode, serializedAdditionalRawData); + return new SourceRegistryCredentials(identity, loginMode, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -111,6 +122,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + if (Identity.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Identity}'''"); + } + else + { + builder.AppendLine($"'{Identity}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LoginMode), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.cs index d89f8a5c03fc..d6110bb4ac72 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.ContainerRegistry.Models { /// Describes the credential parameters for accessing the source registry. - internal partial class SourceRegistryCredentials + public partial class SourceRegistryCredentials { /// /// Keeps track of any properties unknown to the library. @@ -51,18 +51,31 @@ public SourceRegistryCredentials() } /// Initializes a new instance of . + /// + /// The Entra identity used for source registry login. + /// The value is `[system]` for system-assigned managed identity, `[caller]` for caller identity, + /// and client ID for user-assigned managed identity. + /// /// /// The authentication mode which determines the source registry login scope. The credentials for the source registry /// will be generated using the given scope. These credentials will be used to login to /// the source registry during the run. /// /// Keeps track of any properties unknown to the library. - internal SourceRegistryCredentials(SourceRegistryLoginMode? loginMode, IDictionary serializedAdditionalRawData) + internal SourceRegistryCredentials(string identity, SourceRegistryLoginMode? loginMode, IDictionary serializedAdditionalRawData) { + Identity = identity; LoginMode = loginMode; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// + /// The Entra identity used for source registry login. + /// The value is `[system]` for system-assigned managed identity, `[caller]` for caller identity, + /// and client ID for user-assigned managed identity. + /// + [WirePath("identity")] + public string Identity { get; set; } /// /// The authentication mode which determines the source registry login scope. The credentials for the source registry /// will be generated using the given scope. These credentials will be used to login to diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/StorageAccessMode.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/StorageAccessMode.cs new file mode 100644 index 000000000000..f4724722f459 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/StorageAccessMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The storage access mode used for the customer storage account. + public readonly partial struct StorageAccessMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageAccessMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ManagedIdentityValue = "ManagedIdentity"; + private const string SasTokenValue = "SasToken"; + + /// ManagedIdentity. + public static StorageAccessMode ManagedIdentity { get; } = new StorageAccessMode(ManagedIdentityValue); + /// SasToken. + public static StorageAccessMode SasToken { get; } = new StorageAccessMode(SasTokenValue); + /// Determines if two values are the same. + public static bool operator ==(StorageAccessMode left, StorageAccessMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageAccessMode left, StorageAccessMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StorageAccessMode(string value) => new StorageAccessMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StorageAccessMode other && Equals(other); + /// + public bool Equals(StorageAccessMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/AgentPoolsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/AgentPoolsRestOperations.cs index 8d02a25e302f..c15f036e7770 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/AgentPoolsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/AgentPoolsRestOperations.cs @@ -32,7 +32,7 @@ public AgentPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01-preview"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -297,7 +297,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -325,7 +324,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchiveVersionsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchiveVersionsRestOperations.cs new file mode 100644 index 000000000000..8171fbe6ac3b --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchiveVersionsRestOperations.cs @@ -0,0 +1,577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class ArchiveVersionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ArchiveVersionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ArchiveVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-06-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ArchiveVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ArchiveVersionListResult.DeserializeArchiveVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ArchiveVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ArchiveVersionListResult.DeserializeArchiveVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the archive version. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveVersionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryArchiveVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the archive version. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveVersionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryArchiveVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Creates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a archive version from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a archive version from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, packageType, archiveName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ArchiveVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ArchiveVersionListResult.DeserializeArchiveVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, packageType, archiveName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ArchiveVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ArchiveVersionListResult.DeserializeArchiveVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchivesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchivesRestOperations.cs new file mode 100644 index 000000000000..65daaab53db8 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchivesRestOperations.cs @@ -0,0 +1,665 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class ArchivesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ArchivesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ArchivesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-06-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all archives for the specified container registry and package type. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, packageType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ArchiveListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ArchiveListResult.DeserializeArchiveListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all archives for the specified container registry and package type. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, string packageType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, packageType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ArchiveListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ArchiveListResult.DeserializeArchiveListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the archive. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryArchiveData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the archive. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryArchiveData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchiveData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchiveData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The parameters for creating a archive. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchiveData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The parameters for creating a archive. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchiveData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a archive from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a archive from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchivePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchivePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The parameters for updating a archive. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchivePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The parameters for updating a archive. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchivePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all archives for the specified container registry and package type. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, packageType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ArchiveListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ArchiveListResult.DeserializeArchiveListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all archives for the specified container registry and package type. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, packageType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ArchiveListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ArchiveListResult.DeserializeArchiveListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/BuildsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/BuildsRestOperations.cs index a1e41940ede1..bb4c43c3eb00 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/BuildsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/BuildsRestOperations.cs @@ -32,7 +32,7 @@ public BuildsRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01-preview"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs index 47da4d93b01b..2b9f8a5d62b4 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs @@ -32,7 +32,7 @@ public CacheRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-01"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs index 4a21a3113b4f..8cc046387dc9 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs @@ -32,11 +32,11 @@ public ConnectedRegistriesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-01"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string filter) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,13 +46,16 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); uri.AppendPath(registryName, true); - uri.AppendPath("/connectedRegistries/", false); - uri.AppendPath(connectedRegistryName, true); + uri.AppendPath("/connectedRegistries", false); uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string filter) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -65,82 +68,79 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); uri.AppendPath(registryName, true); - uri.AppendPath("/connectedRegistries/", false); - uri.AppendPath(connectedRegistryName, true); + uri.AppendPath("/connectedRegistries", false); uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Gets the properties of the connected registry. + /// Lists all connected registries for the specified container registry. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the container registry. - /// The name of the connected registry. + /// 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. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, filter); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ConnectedRegistryData value = default; + ConnectedRegistryListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); + value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ConnectedRegistryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets the properties of the connected registry. + /// Lists all connected registries for the specified container registry. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the container registry. - /// The name of the connected registry. + /// 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. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, filter); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ConnectedRegistryData value = default; + ConnectedRegistryListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); + value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ConnectedRegistryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -156,11 +156,11 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -174,73 +174,77 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates a connected registry for a container registry with the specified parameters. + /// Gets the properties of the connected registry. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the container registry. /// The name of the connected registry. - /// The parameters for creating a connectedRegistry. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + ConnectedRegistryData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectedRegistryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Creates a connected registry for a container registry with the specified parameters. + /// Gets the properties of the connected registry. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the container registry. /// The name of the connected registry. - /// The parameters for creating a connectedRegistry. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + ConnectedRegistryData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectedRegistryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -256,11 +260,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -276,30 +280,30 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Updates a connected registry with the specified parameters. + /// Creates a connected registry for a container registry with the specified parameters. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the container registry. /// The name of the connected registry. - /// The parameters for updating a connectedRegistry. + /// The parameters for creating a connectedRegistry. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -311,24 +315,24 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } } - /// Updates a connected registry with the specified parameters. + /// Creates a connected registry for a container registry with the specified parameters. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the container registry. /// The name of the connected registry. - /// The parameters for updating a connectedRegistry. + /// The parameters for creating a connectedRegistry. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -434,7 +438,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string filter) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -444,20 +448,17 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); uri.AppendPath(registryName, true); - uri.AppendPath("/connectedRegistries", false); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string filter) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -466,73 +467,72 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); uri.AppendPath(registryName, true); - uri.AppendPath("/connectedRegistries", false); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Lists all connected registries for the specified container registry. + /// Updates a connected registry with the specified parameters. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the container registry. - /// 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. + /// The name of the connected registry. + /// The parameters for updating a connectedRegistry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, filter); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - ConnectedRegistryListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Lists all connected registries for the specified container registry. + /// Updates a connected registry with the specified parameters. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the container registry. - /// 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. + /// The name of the connected registry. + /// The parameters for updating a connectedRegistry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, filter); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - ConnectedRegistryListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs index 626f987933ac..f2148dbd36f2 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs @@ -32,7 +32,7 @@ public CredentialSetsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-01"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs new file mode 100644 index 000000000000..0b316eca06bd --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class ExportPipelinesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExportPipelinesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ExportPipelinesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-06-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all export pipelines for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExportPipelineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all export pipelines for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExportPipelineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the export pipeline. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryExportPipelineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryExportPipelineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the export pipeline. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryExportPipelineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryExportPipelineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ContainerRegistryExportPipelineData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ContainerRegistryExportPipelineData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an export pipeline for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an export pipeline for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an export pipeline from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an export pipeline from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all export pipelines for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExportPipelineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all export pipelines for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExportPipelineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs new file mode 100644 index 000000000000..c547eb31fd3c --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class ImportPipelinesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ImportPipelinesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ImportPipelinesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-06-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all import pipelines for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ImportPipelineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all import pipelines for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ImportPipelineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the import pipeline. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryImportPipelineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryImportPipelineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the import pipeline. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryImportPipelineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryImportPipelineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ContainerRegistryImportPipelineData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ContainerRegistryImportPipelineData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an import pipeline for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, importPipelineName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an import pipeline for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, importPipelineName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an import pipeline from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an import pipeline from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all import pipelines for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ImportPipelineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all import pipelines for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ImportPipelineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs new file mode 100644 index 000000000000..fa9082bb494a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class PipelineRunsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PipelineRunsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public PipelineRunsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-06-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the pipeline runs for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineRunListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the pipeline runs for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineRunListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the detailed information for a given pipeline run. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryPipelineRunData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryPipelineRunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the detailed information for a given pipeline run. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryPipelineRunData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryPipelineRunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a pipeline run for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a pipeline run for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a pipeline run from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a pipeline run from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the pipeline runs for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineRunListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the pipeline runs for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineRunListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index a85b56949851..db6dbce72d44 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-01"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs index 85e10b61ac4e..670358228763 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs @@ -32,7 +32,7 @@ public RegistriesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-01"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs index 1acc4a7e9e26..213c2bf74525 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-01"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RunsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RunsRestOperations.cs index c7fb77cc5d65..14b281fb31f8 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RunsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RunsRestOperations.cs @@ -32,7 +32,7 @@ public RunsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01-preview"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -305,7 +305,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string runId, ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string runId, ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -318,8 +318,12 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + ContainerRegistryRunData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryRunData.DeserializeContainerRegistryRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -334,7 +338,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string runId, ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string registryName, string runId, ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -347,8 +351,12 @@ public Response Update(string subscriptionId, string resourceGroupName, string r switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + ContainerRegistryRunData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerRegistryRunData.DeserializeContainerRegistryRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -516,7 +524,6 @@ public async Task CancelAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 200: - case 202: return message.Response; default: throw new RequestFailedException(message.Response); @@ -543,7 +550,6 @@ public Response Cancel(string subscriptionId, string resourceGroupName, string r switch (message.Response.Status) { case 200: - case 202: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/SchedulesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/SchedulesRestOperations.cs index de92e87061b2..08aee2ac60c3 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/SchedulesRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/SchedulesRestOperations.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; using Azure.Core; @@ -31,7 +32,7 @@ public SchedulesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01-preview"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +84,7 @@ internal HttpMessage CreateScheduleRunRequest(string subscriptionId, string reso /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task ScheduleRunAsync(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryRunContent content, CancellationToken cancellationToken = default) + public async Task> ScheduleRunAsync(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryRunContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -95,8 +96,12 @@ public async Task ScheduleRunAsync(string subscriptionId, string resou switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ContainerRegistryRunData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryRunData.DeserializeContainerRegistryRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -110,7 +115,7 @@ public async Task ScheduleRunAsync(string subscriptionId, string resou /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ScheduleRun(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryRunContent content, CancellationToken cancellationToken = default) + public Response ScheduleRun(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryRunContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -122,8 +127,12 @@ public Response ScheduleRun(string subscriptionId, string resourceGroupName, str switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ContainerRegistryRunData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerRegistryRunData.DeserializeContainerRegistryRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs index b69836ba9bfb..63b77bb97fa2 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs @@ -32,7 +32,7 @@ public ScopeMapsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-01"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TaskRunsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TaskRunsRestOperations.cs index 306f1ba4f97e..2670030b0cce 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TaskRunsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TaskRunsRestOperations.cs @@ -32,7 +32,7 @@ public TaskRunsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01-preview"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -298,7 +298,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 200: - case 202: case 204: return message.Response; default: @@ -326,7 +325,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r switch (message.Response.Status) { case 200: - case 202: case 204: return message.Response; default: diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TasksRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TasksRestOperations.cs index 935b0558abb8..71bd151bfcf3 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TasksRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TasksRestOperations.cs @@ -32,7 +32,7 @@ public TasksRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01-preview"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -285,7 +285,7 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskData data, CancellationToken cancellationToken = default) + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -299,7 +299,12 @@ public async Task CreateAsync(string subscriptionId, string resourceGr { case 200: case 201: - return message.Response; + { + ContainerRegistryTaskData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryTaskData.DeserializeContainerRegistryTaskData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -314,7 +319,7 @@ public async Task CreateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskData data, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -328,7 +333,12 @@ public Response Create(string subscriptionId, string resourceGroupName, string r { case 200: case 201: - return message.Response; + { + ContainerRegistryTaskData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerRegistryTaskData.DeserializeContainerRegistryTaskData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -392,7 +402,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 200: - case 202: case 204: return message.Response; default: @@ -420,7 +429,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r switch (message.Response.Status) { case 200: - case 202: case 204: return message.Response; default: @@ -479,7 +487,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -492,8 +500,12 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + ContainerRegistryTaskData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryTaskData.DeserializeContainerRegistryTaskData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -508,7 +520,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -521,8 +533,12 @@ public Response Update(string subscriptionId, string resourceGroupName, string r switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + ContainerRegistryTaskData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerRegistryTaskData.DeserializeContainerRegistryTaskData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs index 10ba1af82be2..2604c905ca14 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs @@ -32,7 +32,7 @@ public TokensRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-01"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs index 0b36a06d516f..9ebb8b66b0d7 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs @@ -32,7 +32,7 @@ public WebhooksRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-01"; + _apiVersion = apiVersion ?? "2025-06-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs index 3d8c8bc363fe..9250473d21d3 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpdateAsync(Wa /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string scopeMapNa /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string scopeMapName, CancellationT /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken can /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancellationT /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string scopeMapName, Cance /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string scopeMapName, CancellationToken canc /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExistsAsync(s /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs index cb37df2b586c..88e81a247065 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellationToke /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(WaitUntil /// /// /// Default Api Version - /// 2025-04-01 + /// 2025-06-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md index e63afc30bc49..b12d828d1df8 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md @@ -7,7 +7,7 @@ azure-arm: true csharp: true library-name: ContainerRegistry namespace: Azure.ResourceManager.ContainerRegistry -require: https://github.com/Azure/azure-rest-api-specs/blob/a55917cb512540bc3d0aec760d4e28712c3a4ae0/specification/containerregistry/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerregistry/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/